Removing all Toolbars in one line

  • Thread starter Thread starter matt dunbar
  • Start date Start date
M

matt dunbar

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
 
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
 
Back
Top