XL97: Macro Error When You Use GET.TOOLBAR Command

Last reviewed: March 13, 1998
Article ID: Q171309
The information in this article applies to:
  • Microsoft Excel 97 for Windows

SYMPTOMS

In Microsoft Excel 97, when you run a macro written in the Microsoft Excel Macro language (XLM), you may receive an error message similar to the following:

   Macro error at cell:
   [Book3]Macro1!A10

The same macro works correctly in earlier versions of Microsoft Excel.

CAUSE

This problem occurs if the XLM macro contains a line of code that uses the GET.TOOLBAR command with a type_num argument of 1, for example:

   =GET.TOOLBAR(1,"Standard")

RESOLUTION

To correct this problem, install Microsoft Excel 97 Service Release 1 (SR-1).

STATUS

Microsoft has confirmed this to be a problem in Microsoft Excel 97. This problem was corrected in Microsoft Excel 97 SR-1.

For additional information about SR-1, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q172475
   TITLE     : OFF97: How to Obtain and Install MS Office 97 SR-1

MORE INFORMATION

In an XLM macro, you can use the GET.TOOLBAR command to return information about a single toolbar or all toolbars. If you use a type_num argument of 1, the GET.TOOLBAR command returns a horizontal array of all tool IDs on the specified toolbar ordered by position. For example, to display all of the IDs for tools on the Standard toolbar, use XLM code similar to the following:

   =SET.NAME("ToolArray",GET.TOOLBAR(1,"Standard"))
   =FOR("x",1,COLUMNS(ToolArray))
   =ALERT(INDEX(ToolArray,1,x))
   =NEXT()
   =RETURN()

NOTE: The SET.NAME command is entered as an array formula. To do this, press CTRL+SHIFT+ENTER.

This code does not work correctly in Microsoft Excel 97 because the GET.TOOLBAR command fails with a type_num of 1. However, the code works correctly in Microsoft Excel 97 SR-1.


Additional query words: XL97 sr1
Keywords : kberrmsg
Version : WINDOWS:97
Platform : WINDOWS
Issue type : kbbug
Solution Type : kbfix


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: March 13, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.