Archive of Mr Excel Message Board


Back to Excel VBA archive index
Back to archive home



Is there a way to hide Excel menu bar?

Posted by Ken on December 10, 2001 11:34 AM
Just wondering if there is a way to hide excel menu bar. Either through Options or a Macro would be appreciated.

Thanks
Ken


Check out our Excel VBA Resources

Re: Is there a way to hide Excel menu bar?

Posted by Mark W. on December 10, 2001 12:46 PM
Just drag it from its docked position and close it.


I spoke too soon... let me poke around some more... (nt)

Posted by Mark W. on December 10, 2001 12:52 PM


Hi Mark, I tried that, but how do you close menu?

Posted by Ken on December 10, 2001 1:45 PM
Sorry Mark, I am trying to get it, I have dragged the menu bar from the docked position, the only thing I see that you can close is the worksheet, How do you close the excel menu bar?

Thanks
Ken


Re: Hi Mark, I tried that, but how do you close menu?

Posted by Mark W. on December 10, 2001 1:54 PM
I've been stymied at every turn...

I also tried to uncheck the Worksheet Menu Bar using
View | Toolbars | Customize command, but it re-appears
when the [ Close ] button is pressed. I beginning
to believe that it can't be turned-off (at least
not without resorting to VBA).


Re: Hi Mark, I tried that, but how do you close menu?

Posted by Juan Pablo G. on December 10, 2001 2:53 PM
I haven't found the help file yet, but i think i read that "Excel needs to have one Menu Bar visible at all time", so, i don't think this is a chance.

Juan Pablo G.


This is the best I could do, but could not get it to activate on event

Posted by Ken on December 10, 2001 3:41 PM
Sub Disable_Menu_Bar()
CommandBars("Worksheet Menu Bar").Enabled = False
End Sub

Sub Enable_Menu_Bar()
CommandBars("Worksheet Menu Bar").Enabled = True
End Sub

Sub Toggle_Menu_Bar()
If CommandBars("Worksheet Menu Bar").Enabled = True Then
CommandBars("Worksheet Menu Bar").Enabled = False
Else: CommandBars("Worksheet Menu Bar").Enabled = True
End If
End Sub


Re: This is the best I could do, but could not get it to activate on event

Posted by Richard Winfield on December 10, 2001 4:17 PM
This set of macros will remove all excel menus and toolbars except for a custom one that you design. I used this in a packing list program to stop inexperienced users from making changes. When the workbook is opened the autorun macro runs and there are only 2 buttons visible. The close sub is actually part of another macro in this instance, but it will work as a stand alone sub as well. You must first design the custom toolbar and enable it before saving and running the macro. Hope this helps some :)

Sub Auto_Open()
'
' autoopen Macro
' Macro recorded 12/10/2001 by Richard Winfield
'
Application.ScreenUpdating = False
Application.CommandBars("Standard").Visible = False
Application.CommandBars("Formatting").Visible = False
CommandBars("Worksheet Menu Bar").Enabled = False
Application.DisplayFormulaBar = False
'
End Sub


Sub Close
ActiveWorkbook.Close
Application.DisplayAlerts = True
Application.CommandBars("Standard").Visible = True
Application.CommandBars("Formatting").Visible = True
Application.CommandBars("ChangingButton").Visible = True {this is the bar that I designed}
CommandBars("Worksheet Menu Bar").Enabled = True
Application.DisplayFormulaBar = True
Application.ScreenUpdating = True
Exit Sub




This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.