XL98: Custom Menu Merges with Custom Toolbar

ID: Q188495

The information in this article applies to:

SYMPTOMS

When you open a workbook that contains a custom menu bar and an attached toolbar, the menu bar and the toolbar may be merged together. If you use a Visual Basic for Applications macro to control the menu bar or the toolbar, you may receive the following error message:

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

Neither the toolbar nor the menu bar are displayed properly.

CAUSE

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

- 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 98 Macintosh Edition, 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.

Because the custom command bar and the custom toolbar are the same, the custom command bar cannot be renamed. By renaming the command bar, the toolbar is also renamed. To rename the command bar, the file must be opened in an earlier version of Microsoft Excel.

To rename the menu bar in Microsoft Excel 98 Macintosh Edition, follow these steps:

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

   box type a new menu name. Click OK.

MORE INFORMATION

The menu bar structure in Microsoft Excel 98 has changed. Menu bars in Visual Basic for Applications are now referred to as command bars, and they are the same as toolbars. The CommandBar object is a programmable object and applies to the following items:

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."

For more information about customizing menus, from the Visual Basic Editor, click the Office Assistant, type "add menu," click Search, and then click to view "Adding and managing menu bars and menu items."

NOTE: If the Assistant is hidden, click the Office Assistant button on the Standard toolbar. If the Assistant is not able to answer your query, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q176476
   TITLE     : OFF: Office Assistant Not Answering Visual Basic Questions

Additional query words: 8.00 combine menubar menubars
Keywords          : kbprg kbdta xlvbainfo 
Version           : MACINTOSH:98
Platform          : MACINTOSH
Issue type        : kbprb

Last Reviewed: July 12, 1998