View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Removing all Toolbars in one line

Dim ocb As Object

For Each ocb In Application.CommandBars
If ocb.Name < "Worksheet Menu Bar" And _
ocb.Visible Then _
ocb.Visible = False
Next ocb

--

HTH

RP

"matt dunbar" wrote in message
...
Hi all

the Open macro is real useful and I use it to remove the
toolbars/command bars on my workbooks (Restoring the four basic ones
using the Close macro)

I have written code such as

Application.CommandBars("Standard").Visible = False
Application.CommandBars("Formatting").Visible = False
Application.CommandBars("Chart").Visible = False
Application.CommandBars("Control Toolbox").Visible = False

etc

within this Open macro

is there a more efficient way to remove all Toolbars as on some versions
of Excel 2003 there are different and more toolbars to Excel 97

TIA

matt

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!