Hide worksheet menu bar

  Desert Andy 15:51 15 Mar 2004

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 2004


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 2004

Bookmarked for future reference - thanks!

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

Elsewhere on IDG sites

Samsung Galaxy A8 review: Hands-on

Illustrator Juan Esteban Rodriguez on creating highly detailed official film posters for Star Wars…

iMac Pro review

Meilleurs drones (2018)