or...
public sub Handlebars(byval xEnable as boolean)
dim oBar as commandbar
' disable/enable ALL builtin commandabrs (toolbars & menus!)
for each obar in application.commandbars
if obar.builtin then
obar.enabled=not xEnable
end if
next
end sub
then all you do is call it from the Workbook_Open event handler like this:Handlebars true
<<
and in the Workbook_beforeclose event like this:Handlebars false
<<
of course, you will have to modify as needed, for example, if you still want
the user to be able to right-click on a worksheet or cell and show the popup
menus...
also, be careful with code like this, if for example you turn event-handlers
off sometime when the workbook is open (Application.enableevents=false) and
excel crashes, then it won't put them back and you have to do it the awkward
way to reset them again!
Perhaps therefore it's better to use .Visible = false instead of disabling
them...
all depends on why, and if it's a problem when the users show the toolbars
themselves through the Customize dialog by double-clicking in the commandbar
area at the top of Excel...
hth
Philip