Hide all toolbar buttons

L

Lawlera

Is the a quick method to hide all toolbar buttons whilst a particular workbook remains open??
 
G

Greg Wilson

Assuming you meant to hide buttons on the Worksheet Menu
Bar only then I think the following is what you're looking
for. Paste to the ThisWorkbook module of the workbook
involved.

Private Sub Workbook_Open()
Dim Btn As CommandBarControl
For Each Btn In Application.CommandBars(1).Controls
If Btn.Type = msoControlButton Then Btn.Visible = False
Next
End Sub

Private Sub Workbook_Deactivate()
Dim Btn As CommandBarControl
For Each Btn In Application.CommandBars(1).Controls
If Btn.Type = msoControlButton Then Btn.Visible = True
Next
End Sub

Regards,
Greg

-----Original Message-----
Is the a quick method to hide all toolbar buttons whilst
a particular workbook remains open??
 

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