Microsoft KB Archive/93492

{|
 * width="100%"|

Excel: GET.TOOLBAR(9) Function Returns Incomplete Array of IDs

 * }

-

The information in this article applies to:


 * Microsoft Excel for Windows, versions 4.0, 4.0a, 5.0
 * Microsoft Excel for the Macintosh, versions 4.0, 5.0

-

SUMMARY
When you start Microsoft Excel, the docked tool bars are loaded before the floating tool bars. The way these tool bars are loaded may present a problem if you are using an Auto_Open macro that uses the GET.TOOLBAR(9) function. Since the Auto_Open macro may be run before the floating tool bars are loaded, the GET.TOOLBAR(9) function will return an incomplete array of tool bar IDs.

MORE INFORMATION
The GET.TOOLBAR function is used to return information about one tool bar or all tool bars. GET.TOOLBAR(9) returns an array of tool bar IDs for all visible tool bars.

The GET.TOOLBAR function may not return a complete array of tool bar IDs if you use it in an Auto_Open macro (a macro that loads automatically when you start Microsoft Excel). The following situations will cause the macro to run before the floating tool bars are loaded, which will result in an incomplete array of tool bar IDs.

Microsoft Excel for the Macintosh and Microsoft Excel for Windows

 * Placing the sheet containing the Auto_Open macro in the XLSTART subdirectory in Microsoft Excel for Windows or placing it in the Startup Folder in Microsoft Excel for the Macintosh.

Microsoft Excel for Windows

 * Using an &quot;open=&quot; entry in the EXCEL4.INI (version 4.0) or EXCEL5.INI (version 5.0) to automatically open the sheet containing the Auto_Open macro when you start Microsoft Excel.

-or-
 * Using an icon command line of &quot;C:\Excel\Excel.exe\filename.xls&quot; Where filename.xls is the file containing the reference to the Auto_Open macro.

Workaround for Microsoft Excel for Windows
To load the floating tool bars before the macro is started, use one of the following methods to start Microsoft Excel:


 * Create an icon for Microsoft Excel with a command line of &quot;filename.xls&quot;, where filename.xls is the file containing the reference to the Auto_Open macro.
 * From the File menu in Windows File Manager, choose the Run command to start &quot;filename.xls&quot;, where filename.xls is the file containing the reference to the Auto_Open macro.

There is no workaround for Microsoft Excel for the Macintosh.