XL: Errors Changing Chart Axis Value Scale in Macro

Last reviewed: December 1, 1997
Article ID: Q152759
The information in this article applies to:
  • Microsoft Excel for Windows 95, versions 7.0, 7.0a
  • Microsoft Excel for Windows, versions 5.0, 5.0c
  • Microsoft Excel for Windows NT, version 5.0
  • Microsoft Excel for Macintosh, versions 5.0, 5.0a

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.

REFERENCES

For more information about changing the value axis scale, click the Search button in Help and type:

   scale


Additional query words: 5.00 5.00a 5.00c 7.00 7.00a xl5 xl7
Keywords : kbprg xlchart PgmOthr
Version : WINDOWS:5.0,5.0c,7.0,7.0a; MACINTOSH:5.0,5.0a
Platform : MACINTOSH WINDOWS
Issue type : kbprb
Solution Type : kbworkaround


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: December 1, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.