OFF98: Reset Method of CommandBars Rebuilds Menu Bar Only

ID: Q184092

The information in this article applies to:

SYMPTOMS

When you reset a menu on a built-in menu bar by using Microsoft Visual Basic for Applications code, none of the menu items are available.

CAUSE

This problem may occur after you delete a built-in menu from a built-in menu bar, add it back to the built-in menu bar, and then use the Reset method to attempt to restore the built-in menu back to its default settings.

WORKAROUND

To work around this problem, use one of the following methods.

WARNING: Using either of these methods resets all custom menus and menu items on the specified menu bar.

Method 1: Use the Customize Toolbar Dialog Box

1. On the View menu, point to Toolbars, and then click Customize.

2. In the Customize dialog box, click the Toolbars tab.

3. Click the name of the toolbar you want to reset, and then click Reset.

4. Click Close.

Method 2: Use Visual Basic for Applications Code

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

   http://www.microsoft.com/supportnet/refguide/ 

To use Visual Basic for Applications code, follow these steps:

1. Press OPTION+F11 to start the Visual Basic Editor.

2. On the View menu, click Immediate Window.

3. In the Immediate window, type the following code, and then

   press RETURN.

   In Microsoft Excel:

      Application.CommmandBars("Worksheet Menu Bar").Reset

   In other Microsoft Office programs:

      Application.CommmandBars("Menu Bar").Reset

NOTE: The name of the CommandBar object varies according to the product and its built-in menu bar.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.

REFERENCES

For more information about Command Bars, click the Office Assistant, type "CommandBars," click Search, and then click to view "CommandBars Collection Object."

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

   ARTICLE-ID: Q179216
   TITLE     : OFF98: How to Use the Microsoft Office Installer Program

Additional query words: XL98 OFF98
Keywords          : kbprg kbdta OffVBA 
Version           : MACINTOSH:98
Platform          : MACINTOSH
Issue type        : kbbug
Solution Type     : kbpending

Last Reviewed: April 7, 1999