Skip to content

Instantly share code, notes, and snippets.

@alunny
Created April 27, 2015 21:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alunny/e71ba6d02af046fe4275 to your computer and use it in GitHub Desktop.
Save alunny/e71ba6d02af046fe4275 to your computer and use it in GitHub Desktop.
Sub LockAllVisibleToolbars()
Dim cb As CommandBar
For Each cb In CommandBars
If cb.Visible = True Then
cb.Protection = msoBarNoChangeDock + _
msoBarNoChangeVisible + _
msoBarNoCustomize + _
msoBarNoMove + _
msoBarNoResize
End If
Next
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment