View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Project Mangler Project Mangler is offline
external usenet poster
 
Posts: 63
Default Worksheet toolbar

Hi Slim,

Poking around in help

Sub DelBars()
Dim bar As CommandBar
For Each bar In Application.CommandBars
If Not bar.BuiltIn Then bar.Delete
Next
End Sub

Not extensively tested



"Slim Slender" wrote in message
...
What I’m gathering from your reply, JLatham, is that looking beyond my
current situation to ones in which I would have more than one custom
commandbar in a Workbook the approach would be to create each
Worksheet specific commandbar in the Worksheet_Activate event of the
Worksheet rather than in a Workbook level Module, and then delete each
Worksheet specific commandbar with the Worksheet_Deactivate rather
than just hiding them. So all I would need in my current situation is
two procedures, plus one to delete all custom commandbars in the
Workbook in the Workbook_Deactivation event. Correctamundo? ‘Mangler,
could you modify your commandbar delete procedure to be more general,
that is, to delete all copies of all custom commandbars in a Workbook
upon Deactivation?