Maximize Ribbon VBA (1 Viewer)

ted.martin

Registered User.
Local time
Today, 18:48
Joined
Sep 24, 2004
Messages
743
I have an application where I need to Minimize the Ribbon to load a rather large form using as much of the screen as possible; but I do not want to hide it. As such I use the fooloiwng code in the switchboard load event.

Code:
  CommandBars.ExecuteMso "MinimizeRibbon"

The problem is when this application is closed and a different Access database loads, the Ribbon remain Minimized; I need it Maximized.

The following code does not work.

Code:
  CommandBars.ExecuteMso "MaximizeRibbon"

Does anyone know the solution?

Thank you.
 

ted.martin

Registered User.
Local time
Today, 18:48
Joined
Sep 24, 2004
Messages
743
Microsoft logic never fails to surprise me.

Apparently the code above is a Toggle so if the ribbon is already minimized, then the same code
Code:
 CommandBars.ExecuteMso "MinimizeRibbon"
maximizes the Ribbon. :banghead:

So I now use the following code in the Switchboard Load event on applications where I want the maximized ribbon to show.

Code:
 if RibbonIsMinimised = Application.CommandBars("Ribbon").Height < 100 then CommandBars.ExecuteMso "MinimizeRibbon"

On my pc 79 is the Minimized ribbon height and 159 when Maximized; hence I chose 100 !!
 

Dreekx

New member
Local time
Today, 20:48
Joined
Jun 29, 2012
Messages
1
I have tried the above but it doesn't work. I tried a few things and I found the following:
On my PC Ribbon Minimized height = 97 en Maximized = 190
Code: If Application.CommandBars ("Ribbon"). Height <120 Then CommandBars.ExecuteMso "MinimizeRibbon"
I placed the code in the report load and it worked perfectly!
 
Last edited:

Users who are viewing this thread

Top Bottom