Hide ribbon with VBA?

W

wal

Is it possible to hide the ribbon using vba code?

I'm aware of the ToggleRibbon method. But, within a macro, I want to
simply do the following:

If Ribbon is visible, hide it
Else: Keep it hidden
End if

Thanks.
 
T

Tony Jollans

I haven't used this in anger, as it were, but you may be able to use:

CommandBars("Ribbon").Height

.. as a guide. I don't know all the factors that may impact on it but if
it's less than 140 or so, I think it must mean that the ribbon is not
displayed.
 

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

Top