ID: Q171309
The information in this article applies to:
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.
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")
To correct this problem, install Microsoft Excel 97 Service Release 1 (SR-1).
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
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 kbdta KbVBA
Version : WINDOWS:97
Platform : WINDOWS
Issue type : kbbug
Solution Type : kbfix
Last Reviewed: January 7, 1999