XL7: Run-time Error Adding Button to ToolbarLast reviewed: September 3, 1997Article ID: Q130583 |
The information in this article applies to:
SYMPTOMSIn Microsoft Excel, when you use the Add method of the ToolbarButtons collection to add a button to a toolbar, you may receive the following error message:
Run-time error '1004': Add method of Toolbars class failed CAUSEThis behavior occurs if you add a button using a button ID number that is not valid or does not have a corresponding button face. For example, button ID value 146 does not have a corresponding button, and you receive the error message described above when you add a button using this button ID value. In Microsoft Excel, the valid toolbar button ID values range from 1 to 248. However, not every value in this range is available. A table of available toolbar buttons and their button ID values is included in the Toolbar Button ID Values topic in the Visual Basic Reference. Some values are not available, and are correctly displayed in the table of available toolbar buttons as N/A.
REFERENCESFor more information about the available toolbar button ID values, click the Index tab in Visual Basic Reference Help, and type the following text
ToolbarButton Objectand then double-click the selected text to go to the "ToolbarButton Object" topic. In the "ToolbarButton Object" topic, click the "Toolbar Button ID Values" topic.
|
Additional query words:
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |