excel toolbars

  • Thread starter Thread starter Boss73
  • Start date Start date
B

Boss73

Is there a way to make the toolbars in excel not show for a specific
work book.
Would there be a vb code that i can use? All i want to show is what is
on the workbook and the top bar that has the (file insert view tools)
commands. I know you can turn them off in the view tab but i want them
to only be off for specific workbooks and not all of my work books.

any help is appreciated!

-Boss :confused:
 
Boss,

Use the two macros below to turn commandbars Off and On. Call TurnOff from
the worksbook's Activate event, and TurnOn from the DeActivate event. Name
a cell in a blank area of the workbook CBRecord, which is used to store the
names of the commandbars that get turned off.

HTH,
Bernie
MS Excel MVP

Sub TurnOff()
Dim myCB As CommandBar
Dim myCount As Integer
For Each myCB In Application.CommandBars
If myCB.Visible Then
If myCB.Name <> "Worksheet Menu Bar" Then
myCount = myCount + 1
Range("CBRecord").Cells(myCount).Value = myCB.Name
myCB.Visible = False
End If
End If
Next myCB
End Sub

Sub TurnOn()
Dim myCell As Range
For Each myCell In Range("CBRecord").CurrentRegion.Cells
Application.CommandBars(myCell.Value).Visible = True
myCell.ClearContents
Next myCell
End Sub
 
Back
Top