Toolbar lives on

  • Thread starter Thread starter SS
  • Start date Start date
S

SS

Well I have now created a lovely little toolbar. My
problem, when I close the document, the toolbar still
stays open. Plus when I try to reopen the file, it yells
at me for having the toolbar there since it is trying to
create it.

I am sure it is a simple little line of code, I just can't
seem to get it.

Thanks

Sharon
 
In the macro/event that create the toolbar use this code to delete the
toolbar if it exist first before you create it

On Error Resume Next
Application.CommandBars("MyToolBar").Delete
On Error GoTo 0

Run the same code in the event or macro that you run when you cose the workbook
 
Before creating a commandbar it's a good idea to delete it:

Sub DeleteMyBar()
On Error Resume Next
Commandbars("MyBar").Delete
End Sub
 
You guys are all just the best!

Thanks



-----Original Message-----
In the macro/event that create the toolbar use this code to delete the
toolbar if it exist first before you create it

On Error Resume Next
Application.CommandBars("MyToolBar").Delete
On Error GoTo 0

Run the same code in the event or macro that you run when you cose the workbook


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)




"SS" <[email protected]> wrote in
message news:[email protected]...
 
Back
Top