Hide worksheet menu bar

  Desert Andy 15:51 15 Mar 04
Locked

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?

Thanks

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

HTH

  Desert Andy 16:35 15 Mar 04

Whisperer

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

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.

How to get Windows 10 for free | How to install Windows 10: There is still a way to avoid paying…

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

Hands-on with the Star Wars fighting drones you can fly yourself

15 macOS Sierra tips | How to use macOS Sierra: Secret tricks and best new features in Apple's new…