Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Vista/Excel 2007 VBA Determine if the Ribbon is minimized?

How can I programmatically determine if the Ribbon is minimized or not? I
need something like the imaginary function RibbonMinimized() as Boolean.
--
TomThumb
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default Vista/Excel 2007 VBA Determine if the Ribbon is minimized?

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Vista/Excel 2007 VBA Determine if the Ribbon is minimized?

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
--
TomThumb


"Rick Rothstein (MVP - VB)" wrote:

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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007-macro enabled, multi-sheet opening in minimized mode LT Excel Discussion (Misc queries) 0 March 11th 10 05:36 PM
Excel 2007 and Office 2007 stink (so does Vista) P. U. Excel Discussion (Misc queries) 1 March 25th 09 05:21 PM
Excel 2007 opens all sheets minimized Wizard_of_Wires Setting up and Configuration of Excel 0 March 23rd 08 03:18 PM
How can I add the OneNote 2007 icon to the ribbon in Excel 2007? Todd Excel Discussion (Misc queries) 6 February 14th 08 11:22 PM
Excel 2007 Hangs until Minimized CTSMark Excel Discussion (Misc queries) 0 November 24th 06 05:43 PM


All times are GMT +1. The time now is 10:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"