View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] mitchellwma1@yahoo.com is offline
external usenet poster
 
Posts: 2
Default Deactivate workbook commandbar for one sheet?

I've never run into this one before. I usu. need a repeating toolbar
for any sheet in a workbook. Therefore, in the "ThisWorkbook" I copy
this code into each new workbook I make that uses a custom commandbar:



Private Sub Workbook_Activate()
On Error Resume Next
Application.CommandBars("My Assigned Toolbar Name").Visible = True
End Sub
Private Sub Workbook_Deactivate()
' CommandBars disappear (whilst the workbook remains open, but another
is in view)
On Error Resume Next
Application.CommandBars("My Assigned Toolbar Name").Visible = False
End Sub



So that takes care of activating the custom toolbar on workbook open,
and deactivating it on workbook close and the toolbar shows up on any
sheet I create within that workbook.

But, what does one do if one wants to "hide" the toolbar for sheet 2,
say?

Thanks. :oD