Hide tabs and ribbon in Excel with VBA

Some videos you may like

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Jaafar Tribak

Well-known Member
Joined
Dec 5, 2002
Messages
7,607
Office Version
2016
Platform
Windows
Hi
I wonder how to autohide the ribbon and tabs with VBA

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

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
35,943
Office Version
365
Platform
Windows
Cross posted https://www.excelforum.com/excel-pr...ohide-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.
 

Jaafar Tribak

Well-known Member
Joined
Dec 5, 2002
Messages
7,607
Office Version
2016
Platform
Windows
If you mean Auto-Hiding then

Code:
Sub AutoHideRibbon()
    Application.CommandBars.ExecuteMso "HideRibbon"
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,090,119
Messages
5,412,546
Members
403,432
Latest member
cr2141

This Week's Hot Topics

Top