View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bill Manville Bill Manville is offline
external usenet poster
 
Posts: 473
Default removing and replacing toolbars

Paul James wrote:
I would also like to remove all toolbars, but then have those same
toolbars reappear whenever the user opens any other workbook after my
application has closed. Is there a way to do this with VBA?


Close.
You would replace the toolbars as your application is closing.

Sub Auto_Open()
ShowToolbars False
End Sub

Sub Auto_Close()
ShowToolbars True
End Sub

Sub ShowToolbars(ToBeSeen As Boolean)
Dim CB As CommandBar
For Each CB In Application.CommandBars
CB.Enabled = ToBeSeen
Next
End Sub

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - reply in newsgroup