Toolbars = Off

Mike E Golding

Board Regular
Joined
Mar 7, 2002
Messages
71
I have a macro which runs when each sheet is activated to hide the toolbars which have been opened by other:
Sub TOOLBARS_OFF()
Application.DisplayFormulaBar = False
Application.DisplayStatusBar = False
Application.CommandBars("Standard").Visible = False
Application.CommandBars("Formatting").Visible = False
Application.CommandBars("Chart").Visible = False
Application.CommandBars("Control Toolbox").Visible = False
Application.CommandBars("Drawing").Visible = False
Application.CommandBars("External Data").Visible = False
Application.CommandBars("Forms").Visible = False
Application.CommandBars("Picture").Visible = False
Application.CommandBars("PivotTable").Visible = False
Application.CommandBars("Reviewing").Visible = False
Application.CommandBars("Visual Basic").Visible = False
Application.CommandBars("Web").Visible = False
Application.CommandBars("WordArt").Visible = False
End Sub

Please can anyone tell me whether I can use a one liner.
Thanks for any help. Mike.
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Sub TOOLBARS_OFF()
Application.DisplayFormulaBar = False
Application.DisplayStatusBar = False
i = Application.CommandBars.Count
On Error Resume Next
For j = 2 To i
Application.CommandBars(j).Visible = False
Next

End Sub

Good Luck,
Josh
 
Upvote 0
Don't know about simplifying the code, but there are a bunch of other toolbars available that you are not closing. For example, I always have the auditing toolbar open. To see all of them, right click the menu area and select customize to see all of them.
 
Upvote 0
Thankss a million to both Yesuslave and Seti. I finally got time to get back and will get into both replies...Thanks again...Mike
 
Upvote 0

Forum statistics

Threads
1,214,919
Messages
6,122,259
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top