Hide tabs and ribbon in Excel with VBA

Jaafar Tribak

Well-known Member
Joined
Dec 5, 2002
Messages
7,423
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
30,476
Office Version
365
Platform
Windows
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.
 

Jaafar Tribak

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

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

Forum statistics

Threads
1,078,356
Messages
5,339,732
Members
399,320
Latest member
zim1984

Some videos you may like

This Week's Hot Topics

Top