Hide worksheet menu bar

  Desert Andy 15:51 15 Mar 04

I am writing a program in Excel using visual basic, and I would very much like to hide the worksheet menu bar, since I don't want the users to access anything they shouldn't. Using custimise I can deselect the worksheet menu bar and it disappears, however as son as i press ok, it immediately reappears.

Can anybody help please?


Andy Evans

Place the following line of code in the ThisWorkbook module in the Sub Workbook_Open

Application.CommandBars("Worksheet Menu Bar").Enabled = False

And the same line excepting False becomes True
in the same place in the Workbook_BeforeClose


  Desert Andy 16:35 15 Mar 04


Thanks very much, you have helped me no end!
Many thanks

Andy went on to ask how to remove the title bar from the screen.

This is easily achieved by selecting the full screen mode, when used in combination with the remove Menu Bar it can only be reversed by VBA.

The following code does both plus a few others that can be easily modified to suit

Sub MaxScreen()

Application.DisplayFullScreen = True

Application.CommandBars("Worksheet Menu Bar").Enabled = False

With ActiveWindow

.DisplayGridlines = True

.GridlineColorIndex = 15

.DisplayHeadings = False

.DisplayHorizontalScrollBar = False

.DisplayWorkbookTabs = False

End With

End Sub

  VoG II 21:25 15 Mar 04

Bookmarked for future reference - thanks!

This thread is now locked and can not be replied to.

Huawei P10 review

1995-2015: How technology has changed the world in 20 years

An overview: What leading creative agencies are doing to improve diversity

New iPad, iPhone SE & Red iPhone 7 on sale now