Hiding Menu Bar

  • Thread starter Thread starter David W
  • Start date Start date
D

David W

Is there a way to hide the menu bar, I know that you can right click on the
toolbar and go to the bottom and uncheck menubar, but when you click on OK
it comes right back.
I don't wont others to have the option to go and use it, I have got codes
for all of the events that the sheets need.
And if you do get it to go away how do you get it back
 
Hi David W,

Always it must there be one visible menu bar, then you have to create an
empty menu bar. Try this:
1 - Open your workbook
2 - Press Alt+F11 to open VBE window
3 - Insert a standard module and
4 - Put the code below on it:

Dim MyMenuBar As CommandBar

Sub CreateMyMenuBar()
Set MyMenuBar = CommandBars.Add(Name:="MyMenu", Position:=msoBarTop,
MenuBar:=True, Temporary:=True)
MyMenuBar.Visible = True
End Sub

Sub DeleteMyMenuBar()
On Error Resume Next
MyMenuBar.Delete
Set MyMenuBar = Nothing
End Sub

5 - Double ThisWorkbook object and insert these event codes:

Private Sub Workbook_Activate()
CreateMyMenuBar
End Sub

Private Sub Workbook_Deactivate()
DeleteMyMenuBar
End Sub


HTH
 
Back
Top