removing a toolbar with code

G

Guest

I have been trying to get a file to remove a toolbar when the file is closed.
Currently the toolbar is generated with code upon opening the file. This
works good.
But, I cannot figure out how to get it to delete when I close the file.
This is what I have at this point:

Private Sub App_WorkbookBeforeClose(ByVal Wb As Workbook, _
Cancel As Boolean)
Application.CommandBars("my toolbar").Delete
Cancel = False

End Sub

TIA
 
G

Guest

A workbook level event would be fine with me, but I couldn't get it to work
so I settled for application level.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top