Minimize Ribbon

ExcelRoy

Well-known Member
Joined
Oct 2, 2006
Messages
2,450
Office Version
  1. 2007
Platform
  1. Windows
Hi all,

could i please ask for a line of code to minimize the ribbon, then to expand the ribbon

Only to minimize and not remove

Many thanks
 

Some videos you may like

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
17,386
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Try:
Code:
CommandBars.ExecuteMso "MinimizeRibbon"
 

ExcelRoy

Well-known Member
Joined
Oct 2, 2006
Messages
2,450
Office Version
  1. 2007
Platform
  1. Windows
Hi JoeMo,

Sorry this doesnt work?
I have the following code so far
Code:
Private Sub Workbook_Open()
    Application.Goto Cells(1)
    Application.DisplayFormulaBar = False
    Application.DisplayStatusBar = False
    ActiveWindow.DisplayWorkbookTabs = False
    ActiveWindow.DisplayHorizontalScrollBar = False
    ActiveWindow.DisplayVerticalScrollBar = False
    ActiveWindow.DisplayHeadings = False
End Sub
Thanks
 
Last edited:

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
17,386
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Hi JoeMo,

Sorry this doesnt work?
I have the following code so far
Code:
Private Sub Workbook_Open()
    Application.Goto Cells(1)
    Application.DisplayFormulaBar = False
    Application.DisplayStatusBar = False
    ActiveWindow.DisplayWorkbookTabs = False
    ActiveWindow.DisplayHorizontalScrollBar = False
    ActiveWindow.DisplayVerticalScrollBar = False
    ActiveWindow.DisplayHeadings = False
End Sub
Thanks
Put the procedure below in a standard module and then add this line to your Workbook_Open event macro:
Call MinRibbon

Code:
Sub MinRibbon()
CommandBars.ExecuteMso "MinimizeRibbon"
End Sub
 

ExcelRoy

Well-known Member
Joined
Oct 2, 2006
Messages
2,450
Office Version
  1. 2007
Platform
  1. Windows

ADVERTISEMENT

Hi JoeMo,

many thanks, I take it I just change Minimize to Maximize to unhide

Thanks
 

ExcelRoy

Well-known Member
Joined
Oct 2, 2006
Messages
2,450
Office Version
  1. 2007
Platform
  1. Windows
Hi JoeMo,

Still not working, may the problem be I am using 2007?

Thanks
 

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
17,386
Office Version
  1. 365
  2. 2010
Platform
  1. Windows

ADVERTISEMENT

Hi JoeMo,

many thanks, I take it I just change Minimize to Maximize to unhide

Thanks
You are welcome. NO - if the ribbon is minimized, just run the MinRibbon procedure again to maximize it.
 

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
17,386
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Hi JoeMo,

Still not working, may the problem be I am using 2007?

Thanks
Yes, that's likely your problem - I'm running Excel 2010. Untested, but a possible alternative is to replace the CommandBars.ExecuteMso ... line with this:

Application.SendKeys "^{F1}"
 

Eric W

MrExcel MVP
Joined
Aug 18, 2015
Messages
10,602
This also may work:

ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"", true )"

Change the true to false to hide it. But it really hides more than the ribbon, the QAT too.
 

ExcelRoy

Well-known Member
Joined
Oct 2, 2006
Messages
2,450
Office Version
  1. 2007
Platform
  1. Windows
Hi JiMoe,

Maybe I was a bit forward as I cannot seem to get it working, could it be because I am using 2007?

Thanks
 

Watch MrExcel Video

Forum statistics

Threads
1,122,193
Messages
5,594,774
Members
413,934
Latest member
austinb

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top