XL5: Can't Use Toolbar Button Name to Index Toolbar Buttons

Last reviewed: September 12, 1996
Article ID: Q112099
The information in this article applies to:
  • Microsoft Excel for Windows, version 5.0

SUMMARY

In Microsoft Excel version 5.0, the Visual Basic Reference Help topic on the ToolbarButton Method incorrectly states that you can use the name of a button to index toolbar buttons. This information is incorrect. If you use the name of the toolbar button to index the button, you will receive the following error message:

   Run-time error '1004':
   ToolbarButtons method of Toolbar class failed.

To index a toolbar button, you must use the number of the button, not the name.

MORE INFORMATION

To find the toolbar button's number, count the buttons (from left to right) on the toolbar that contains the button.

NOTE: Blank spaces between buttons count as one button.

To find the ToolbarButton Method Help topic, do the following:

  1. From the Help menu, choose Contents, and select Programming with Visual Basic.

  2. Choose Search, and type the following:

          ToolbarButtons Method
    

  3. Choose Show Topics, then choose Go To.


KBCategory: kbdocerr
KBSubcategory:

Additional reference words: 5.00



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