Hide tabs and ribbon in Excel with VBA

Jaafar Tribak

Well-known Member
I wonder how to autohide the ribbon and tabs with VBA

One way :
Sub ShowRibbon(ByVal Show As Boolean)
  Application.ExecuteExcel4Macro "Show.ToolBar(""Ribbon""," & Show & ")"
End Sub
Then to hide it :
Sub Test()
    Call ShowRibbon([COLOR=#0000ff]False[/COLOR])
End Sub
To show it:
Sub Test()
    Call ShowRibbon([COLOR=#0000ff]True[/COLOR])
End Sub


MrExcel MVP, Moderator
Cross posted https://www.excelforum.com/excel-programming-vba-macros/1292816-autohide-ribbon-and-tabs-in-excel-using-vba.html

While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules).
This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.

Some videos you may like

This Week's Hot Topics