Toggling the Ribbon

As I haven’t had a chance to post anything for ages, here’s a simple routine to toggle the visibility of the Ribbon:

Sub ToggleRibbon()
Dim bShow                       As Boolean
bShow = Not Application.ExecuteExcel4Macro("GET.TOOLBAR(7, ""Ribbon"")")
Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon""," & bShow & ")"
End Sub

One thought on “Toggling the Ribbon

  1. David Wenta says:

    “Toggle the ribbon macro” is handy. Might want to caution the user to assign an available hotkey, though.
    Of course, they could just Alt F11 to the VB editor and press the F5. Is there a macro for replacing the ribbon and giving us back the old text menus?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.