Article ID: 207157
Article Last Modified on 6/23/2005
CommandBars("MenuBar2").Visible = True
If MenuBar2 is displayed on your screen, the following line of code
automatically sets the Visible property of MenuBar2 to False:
CommandBars("MenuBar1").Visible = True
In order to display more than one menu bar at a time, you must create your
new menu bar or view an existing one through the user interface as follows:
Public strCurrentMenuName As String
'******************************************************************* ' This procedure creates a new menu bar and makes it visible. '******************************************************************* Sub CreateMenuBar(strNewMenuName as String) Dim cmdNewMenu As CommandBar ' Set Global strCurrentMenuName to existing menu for use later when ' toggling. strCurrentMenuName = CommandBars.ActiveMenuBar.Name ' Create a new menu bar. Set cmdNewMenu = Application.CommandBars.Add(strNewMenuName, _ msoBarFloating, True, False) With cmdNewMenu ' Set Protection property to no protection so users can customize ' it. .Protection = msoBarNoProtection ' Show new menu. .Visible = True End With End Sub
CreateMenuBar "ExampleMenu"When you minimize the Visual Basic Editor you that see a new floating menu bar is displayed on the screen, and that the original menu bar is hidden from view.
CommandBars(strCurrentMenuName).Visible = TrueNote that the original menu bar reappears, and your custom menu bar disappears.
209974 ACC2000: How to Create Command Bars by Using Visual Basic Code
Additional query words: Cmdbar menubar commandbar display show hide invisible disappear appear
Keywords: kbui kbprb KB207157