Minimising the Ribbon in an Auto_Open macro

J

Jeff Wiggins

Hi,

I am trying to get an Auto_Open macro to minimise the ribbon in Excel 2007,
but the Ctrl+F1 won't appear in the macro.
Can someone please let me know what I am doing wrong ?
 
R

Rick Rothstein \(MVP - VB\)

Minimize the Ribbon? Do you mean *hide* the Ribbon? If you execute this
line...

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

in the Workbook_Open event, and if the user Enables Macros, then the Ribbon
will be *hidden* at startup. If you ever want to bring it back via code,
change the False to True.

Rick
 
J

Jeff Wiggins

Thanks Rick,

I'm a self taught 'exceller' so I was having a bit of trouble. It works well.

Much appreciated. Jeff (Australia)
--

Rick Rothstein (MVP - VB) said:
Minimize the Ribbon? Do you mean *hide* the Ribbon? If you execute this
line...

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

in the Workbook_Open event, and if the user Enables Macros, then the Ribbon
will be *hidden* at startup. If you ever want to bring it back via code,
change the False to True.

Rick
 
R

Ron de Bruin

You can also Use XML

See this page for a example
http://www.rondebruin.nl/ribbon.htm

In the XML examples (number 2)
you can find a dictator example


<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">


<!-- **************************************************************************-->
<!-- ****Disable 'Exit Excel' and 'Excel Options' on the Office button menu****-->
<!-- **************************************************************************-->

<commands>
<!-- Disable Excel Options on the Office button menu-->
<command idMso="ApplicationOptionsDialog" enabled="false"/>

<!-- Disable Exit Excel on the Office button menu-->
<command idMso="FileExit" enabled="false"/>
</commands>



<!-- *******************************************************************-->
<!-- **********Set startFromScratch to true to hide the ribbon**********-->
<!-- **********Hide New, Open and Save on the Office button menu********-->
<!-- *******************************************************************-->


<!-- Set startFromScratch to true to hide the ribbon-->
<ribbon startFromScratch="true">

<!-- startFromScratch="true" hides all of the ribbon tabs and it hides the QAT. -->
<!-- It also hides most of the commands on the Office button menu, but for some -->
<!-- reason, it does not hide the 'New', 'Open' and 'Save' commands. -->
<!-- So if you want to hide them you have to add this to your RibbonX file: -->

<officeMenu>
<button idMso="FileNew" visible="false"/>
<button idMso="FileOpen" visible="false"/>
<button idMso="FileSave" visible="false" />
</officeMenu>

<!-- You can add xml here to create your own custom tab on the ribbon-->

</ribbon>


</customUI>



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


Rick Rothstein (MVP - VB) said:
Minimize the Ribbon? Do you mean *hide* the Ribbon? If you execute this
line...

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

in the Workbook_Open event, and if the user Enables Macros, then the Ribbon
will be *hidden* at startup. If you ever want to bring it back via code,
change the False to True.

Rick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top