I have written a file where I do not want other users to access the 'tools - macros' toolbar. Is there some simple code to either hide the 'Worksheet Menu Bar' or at least diable the 'Tools - Macro' function on the 'Worksheet Menu Bar'?
Help!
Printable View
I have written a file where I do not want other users to access the 'tools - macros' toolbar. Is there some simple code to either hide the 'Worksheet Menu Bar' or at least diable the 'Tools - Macro' function on the 'Worksheet Menu Bar'?
Help!
I don't think you can easily hide the menu bar. In my experience people almost always end up with more problems than they bargained for when messing with standard Office toolbars, but here's how you kill the Macro menu item:
:)VB Code:
Application.CommandBars("Tools").Controls("Macro").Delete
Many thanks, more research has revealed the following code
Dim cbar As CommandBar
For Each cbar In CommandBars
If cbar.Enabled And cbar.Type = msoBarTypeNormal Then
cbar.Visible = False
End If
Next cbar
CommandBars("Worksheet Menu Bar").Enabled = False
It works well, however, the closing code must return the spread sheet back to normal or all sorts of grief occurs.
Many thanks again
GB
Ahh, yes. I didn't think of disabling the toolbars.