Vista/Excel 2007 VBA Determine if the Ribbon is minimized?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I programmatically determine if the Ribbon is minimized or not? I
need something like the imaginary function RibbonMinimized() as Boolean.
 
How can I programmatically determine if the Ribbon is minimized or not? I
need something like the imaginary function RibbonMinimized() as Boolean.

You can get the height of the Ribbon this way...

RibbonHeight = CommandBars("Ribbon").Height

and on my system, it is 150 when opened and 59 when minimized; however, I am
sure those numbers are not fixed and vary with display resolution and other
user settings. With that said, it would seem likely that 100 would be
possible test point. I'm thinking of something like this...

If CommandBars("Ribbon").Height < 100 Then
' Ribbon is probably minimized
Else
' Ribbon is probably maximized
End If

Remember... that break point is a **guess** on my part. If I can find
something more substantial, I'll post back.

Rick
 
Thank you, Rick! You really nailed this one.
On my machine I get 55 minimized and 146 maximized.
This is a real help to me, Thanks again
 

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

Back
Top