Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

excel: disable toolbars

Status
Not open for further replies.

scroce

MIS
Nov 30, 2000
780
US
Is there any way to disable a user right clicking or double clicking the toolbar? In other words, I only want them seeing the Standard and Formatting Toolbars, and I want to bar them from right-clicking and then hitting "customize..."

I was able to disable these choices on the menubars using,
Code:
myMenu = Application.CommandBars("Worksheet Menu Bar")
myMenu.Controls("Tools").Controls("Customize...").Enabled = False

but you can easily get around this by doing the above. Q: Why is my computer doing that?
A: Random Perversity of Inanimate
Objects
 
Well, for anyone who might need this in the future here's what I have found so far -

There seems to be no identifyable way of disabling the double click on the toolbar that allows you to customize it unless you disable the double click entirely in the sheet:

This ought to disable the right click
CommandBars("ToolBar List").Enabled = False

This ought to disable the double click - a little harsh, but I haven't seen another way yet:
Code:
Sub No_dbl_click()
    Application.OnDoubleClick = "doNothing" 'redirect the double click
    CommandBars("ToolBar List").Enabled = False 'turn off right click
End Sub

Sub doNothing()
    'no code
End Sub

Sub reset_dbl_click()
    Application.OnDoubleClick = "" 'this resets the double click to normal
    CommandBars("ToolBar List").Enabled = True ' this turns on the right click
End Sub
Q: Why is my computer doing that?
A: Random Perversity of Inanimate
Objects
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top