Hide or minimize Ribbon but show Quick Accsess Toolbar in VBA code

joelin

New Member
Joined
Oct 14, 2006
Messages
28
Hi all,

Is there a way using VBA to minimize the Ribbon in Excel 2007 and
disable maximize for a specific worksheet.

I find a way to hide the ribbon completely using eexecute excel4macro
but it hides even the munu.
I want to hide the ribbon but QAT is show on

thanks,


Sub HideRibbon()

Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",False)"

End Sub



Sub ShowRibbon()

Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",True)"

End Sub
 
Welcome to the Forum,

If you place this in your workbook where you want to hide the Ribbon. It has to go into the Workbook Event for On Open. To do this:

Open your workbook > Use Alt + F11 to go into VBA > On the left Double click where it states ThisWorkBook > At the top click General and change to Workbook. Add this code

<font face=Courier New><SPAN style="color:#007F00">'Hide the Ribbon</SPAN><br>Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""RIBBON"", FALSE)"</FONT>

If you then want to Display the Ribbon again when the workbook closes. Top right of current screen (Inside ThisWorkBook), Select procedure BeforeClose > Add this code

<font face=Courier New><SPAN style="color:#007F00">'Show the Ribbon</SPAN><br>Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""RIBBON"", TRUE)"</FONT>
 
Upvote 0

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

Forum statistics

Threads
1,224,847
Messages
6,181,337
Members
453,032
Latest member
Pauh

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
Back
Top