Removing all Toolbars in one line

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
 
B

Bob Phillips

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top