ExcelRoy

Well-known Member
Joined
Oct 2, 2006
Messages
2,540
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have found the following command to minimize the ribbon and have added it to my Workbook_Open commands

Application.SendKeys "^{F1}"

Can I revert back to the ribbon being static using another command to cancel out this one for a Workbook_Close command

Many thanks
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Hi,

I have found the following command to minimize the ribbon and have added it to my Workbook_Open commands

Application.SendKeys "^{F1}"

Can I revert back to the ribbon being static using another command to cancel out this one for a Workbook_Close command
Yes, just execute the above statement again.. the CTRL+F1 keystroke (what that SendKeys statement is issuing) is a toggle for showing/hiding the ribbon. Of course, the user can screw things up if he/she knows about the CTRL+F1 shortcut... suppose you hide the ribbon and sometime during the session, the user shows the ribbon using CTRL+F1... then next time you issue the above SendKeys, it will now hide the ribbon because it is now showing.
 
Last edited:
Upvote 0
Ah I see, many thanks Rick, appreciate your help
 
Upvote 0
Hi Rick, Strangely though, if I close the workbook and reopen it sometimes doesn't minimize the ribbon?

Is there a more robust way of achieving the same result?
 
Upvote 0
Ah I see, many thanks Rick, appreciate your help
By the way, hiding the ribbon that way does not restrict the user from using the ribbon because all the ribbon's tabs are still showing... clicking on one exposes the ribbon as a drop down. And that may be what you are after. However, if you want to totally deny the user access to the ribbon (meaning you have to give them a direct method to close the workbook), then you can do this (hides both the ribbon and its tabs)...

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

and to show them again, execute this...

ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",True)"
 
Upvote 0
Hi Rick,

Many thanks for your help

I was looking to minimize the ribbon to save space but still allow the user the buttons if needed, sorry to be a pain

Thanks
 
Upvote 0

Forum statistics

Threads
1,214,411
Messages
6,119,346
Members
448,888
Latest member
Arle8907

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