Microsoft KB Archive/152759

= Errors Changing Chart Axis Value Scale in Macro =

Article ID: 152759

Article Last Modified on 10/11/2006

-

APPLIES TO


 * Microsoft Excel 95a
 * Microsoft Excel 5.0c
 * Microsoft Excel 5.0 Standard Edition
 * Microsoft Excel 5.0a for Macintosh

-



This article was previously published under Q152759



SYMPTOMS
When you set the axis values on a chart through a macro using the MimimumScale and/or MaximumScale properties, you may receive the following error message:

Run-Time Error 1005:

"Maximum axis value must be greater than minimum axis value. "



CAUSE
The error message may appear if the following is true:


 * The values are calculated in the macro. -and-


 * The value that you are setting is outside the range of the current values.

NOTE: If the new values are hard coded into the macro, instead of using calculated values, you will not receive the error message.



RESOLUTION
To resolve the error message, reverse the order of the commands in the macro. For example, if you are setting the low (minimum) value first and that is the line of code that is generating the error message, set the high (maximum) value first. If you are setting the high (maximum) value first and that is the line of code that is generating the error message, set the low (minimum) value first.

