Hide ribbon / Tabs in Excel with VBA

elmo2000

New Member
Joined
Oct 2, 2017
Messages
15
Hi there,

I found

Sub Workbook_Open()
Application.ExecuteExcel4Macro "show.toolbar(""Ribbon"",False)"
End Sub

To hide the entire Ribbon on start up of the workbook. Works perfect.
But I want to have the save and print options visible.
Do you guys have any solution for that?

Tx!
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Alternate method:

Not sure if you've ever played with XML and ribbon editing, but you could use this as your custom XML for the file to get the desired effects.

NOTE: Remove all of the periods and change | to / before using... (I had to add to get it to post)


<!--
Hide everything on the ribbon (but the File tab called 'backstage', which will be empty).
Show the Quick Access Toolbar (QAT) with the Save and QuickPrint visible.
Tested on Excel 2010. No VBA code needed.

Insert below XML with the Custom UI Editor into an Office document:
http://openxmldeveloper.org/blog/b/openxmldeveloper/archive/2009/08/06/7293.aspx
Tutorial: http://www.rondebruin.nl/win/s2/win001.htm
-->
<.customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<.ribbon startFromScratch="true">
<.qat>
<.sharedControls>
<.control idMso="FileSave" visible="true"/>
<.control idMso="FilePrintQuick" visible="true"/>
<|sharedControls>
<|qat>
<.tabs >
<.tab idMso="TabHome" visible="false"/>
<.tab idMso="TabInsert" visible="false"/>
<.tab idMso="TabPageLayoutExcel" visible="false"/>
<.tab idMso="TabFormulas" visible="false"/>
<.tab idMso="TabData" visible="false"/>
<.tab idMso="TabReview" visible="false"/>
<.tab idMso="TabView" visible="false"/>
<.tab idMso="TabAddIns" visible="false"/>
<.tab idMso="TabPrintPreview" visible="false"/>
<|tabs >
<|ribbon. >
<|customUI.>

To download the Custom UI Editor: http://openxmldeveloper.org/blog/b/openxmldeveloper/archive/2009/08/06/7293.aspx

For info on how it works: http://www.rondebruin.nl/win/s2/win001.htm
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,304
Members
452,633
Latest member
DougMo

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