XL97: Custom Menu Merges with Custom Toolbar

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

SYMPTOMS

A custom toolbar and custom menu bar merge together as one toolbar. If the menu bar or toolbar are controlled by macro code, you may receive the following error message:

   Run-time error '1004':
   Application-defined or object-defined error

and neither the toolbar nor the menu bar are displayed properly.

CAUSE

This behavior occurs when both of the following conditions are true:

  • The custom menu was created using the Menu Editor in Microsoft Excel version 5.0 or 7.0.

    -and-

  • The custom toolbar was attached to the workbook.

    -and-

- The names of both the toolbar and menu bar are the same.

The merged menu bar and toolbar will function correctly; however, the menu bar will simply be displayed on a toolbar instead of the menu as expected.

WORKAROUND

For a custom menu bar to be referred to separately from a custom toolbar in Microsoft Excel 97, each name must be unique. If the toolbar and menu bar are given the same name, they are merged as a toolbar. Microsoft Excel does not recognize that the menu bar is a menu if a toolbar has the same name.

The custom CommandBar cannot be renamed because it and the custom Toolbar are one and the same. By renaming the CommandBar, the toolbar is renamed as well. To rename the CommandBar, the file must be opened in an earlier version of Microsoft Excel, such as version 5.0 or 7.0.

To rename the menu bar in Microsoft Excel 5.0 and 7.0

  1. Open the workbook and activate the module sheet.

  2. On the Tools menu, click Menu Editor.

  3. On the Menu bars list, click the custom menu bar. In the Caption text box type a new menu name. Click OK.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

The menu bar structure in Microsoft Excel 97 has changed. Menubars in Visual Basic for Applications are now referred to as CommandBars and are fundamentally the same as toolbars. The CommandBar object is a programmable object and applies to the following items:

  • Menu bars, toolbars and shortcut menus
  • Menus on menu bars and toolbars
  • Submenus on menus, submenus, and shortcut menus

REFERENCES

For more information about customizing menus, click the Office Assistant, type "add menu", click Search, and then click to view "Add a command to a menu."

NOTE: If the Assistant is hidden, click the Office Assistant button on the Standard toolbar. If Microsoft Excel Help is not installed on your computer, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q120802
   TITLE     : Office: How to Add/Remove a Single Office Program or
               Component


Additional query words: XL97 8.00 combine menubar menubars
Keywords : kbcode kbprg xlvbainfo
Version : WINDOWS:97
Platform : WINDOWS
Issue type : kbprb


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.