Thread: delete toolbar
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jan Karel Pieterse Jan Karel Pieterse is offline
external usenet poster
 
Posts: 535
Default delete toolbar

Hi Drhalter,

That's great. I posted just prior to yours, I happened to think of how to do
it about 2 seconds after I posted the original question. But, any ideas on
how to test whether the toolbar exists? I have the following code in a
workbook_sheetcalculate event:

If application.commandbars("myBar").visible = true then

but I get an error when myBar doesn't exist. The code works great when the
toolbar does exist.


Dim oBar as CommandBar
On Error Resume next
Set oBar=Application.Commandbars("YourBar")
If oBar is nothing then
'Bar is absent
Else
'Do your thing
End If

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com