How to hide Excel's Top Menu Bar

H

Hotbird

On occasions, I need to display a single page (of a multiple page
spreadsheet) full-screen without any embellishment.

My code for the relevant sheet is appended at the end of this post, with
Application.DisplayFullScreen = True and ActiveWindow.DisplayWorkbookTabs =
False doing the "work". This almost gives me what I want, except that the
top level menu bar (FILE, EDIT, VIEW, INSERT, FORMAT, TOOLS, DATA, WINDOW,
HELP) remains - and is needed at all other times. Is there a VBA method to
hide this unwanted item?

Option Explicit
Private Sub Worksheet_Activate()
Application.OnKey "{F5}", "TypeF5" ' PREVIOUS QUESTION
Application.OnKey "{F6}", "TypeF6" ' NEXT QUESTION

Application.DisplayFullScreen = True
ActiveWindow.DisplayWorkbookTabs = False

End Sub

Private Sub Worksheet_Deactivate()
Application.OnKey "{F5}"
Application.OnKey "{F6}"

Application.DisplayFullScreen = False
ActiveWindow.DisplayWorkbookTabs = True

End Sub
 
G

Gord Dibben

Hotbird

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

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

Gord Dibben XL2002
 
H

Hotbird

Many thanks Gord and Vasant. Your solutions worked like a dream. What a
resource this NewsGroup is!!!

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

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

Gord Dibben XL2002
CommandBars(1).Enabled = False
 
G

Gord Dibben

Thanks Hotbird

Great to get feedback.

These newsgroup are definitely a great resource.

Gord
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top