ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Removing all Toolbars in one line (https://www.excelbanter.com/excel-programming/312344-removing-all-toolbars-one-line.html)

matt dunbar

Removing all Toolbars in one line
 
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!

Bob Phillips[_6_]

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!





All times are GMT +1. The time now is 10:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com