ToolBars

  • Thread starter Thread starter bach
  • Start date Start date
B

bach

Forum,

Hope you can help, I have joined today as well so be nice :cool:

I am creating a worksheet that will require all of the toolbars to b
removed on the worksheet open, and all the toolbars returned when th
worksheet closes.

I have seen this done, a worksheet was opened and there were n
toolbars including the menu one. Could someone help me out.

Regards,

Bac
 
You need to use VB code, here is a method courtesy of Ron De Bruin. If
you're unfamiliar with code, post back,
Regards,
Alan.

Private Sub Workbook_Activate ()
Dim bar As CommandBar
For Each bar In Application.CommandBars
bar.Enabled = False
Next
End Sub


Private Sub Workbook_Deactivate ()
Dim bar As CommandBar
For Each bar In Application.CommandBars
bar.Enabled = True
Next
End Sub
 
Alan,

Thanks for reply to my post, I have used the code and the only issue I
have is that the formula bar remains is this supose to happen.??

Bach
 
It is because it is not a commandbar. You can fix it though

Dim mFormulaBar

Sub RemoveFormulaBar()
mFormulaBar = Application.DisplayFormulaBar
Application.DisplayFormulaBar = False
End Sub


Sub RestoreFormulaBar()
Application.DisplayFormulaBar = mFormulaBar
End Sub
 
Back
Top