Checking the state of the Ribbon bar

mark hansen

Well-known Member
Joined
Mar 6, 2006
Messages
534
Office Version
  1. 2016
Platform
  1. Windows
We are using XL 2007.
I use the send keys to get rid of the ribbon bar when some of my spreadsheet open. And again when they close, to put it back. Some of my users really like this and asked me how I did it., Well I told them and now some run without the ribbon bar.

The problem is when they open my spreadsheet, it puts it back, causing some confusion.

Is there a way to check the state of the ribbon bar (open or closed) and only use the send keys to close it if its Open?
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
You can check the height of the ribbon using,

Code:
application.commandbars("Ribbon").height

xl2007 is 59 minimized and 150 shown.
xl2010 is 53 minimized, 141 shown.

Regardless of the actual height you can compare the height before and after the command then repeat command as required.
 
Upvote 0
Oh woe, that's great Andy, thanks. I'll try it when i get to work tomorrow!!!
Thanks again!

Mark
 
Upvote 0

Forum statistics

Threads
1,224,579
Messages
6,179,656
Members
452,934
Latest member
mm1t1

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