How to permanently delete a custom toolbar

  • Thread starter Thread starter 39N95W
  • Start date Start date
3

39N95W

Windows XP
Excel 2002 & 2003

Back when I was first learning VBA I made my own custom toolbar and added a
few buttons to it. It was created via right clicking on an existing toolbar
and choosing Customize..., not programmatically. The buttons didn't
actually do anything though. Anyway, it seems I have unknowingly spread
this toolbar around the office. How would I permanently delete this
innocuous little monster? I tried the code below and it didn't work, but it
didn't give an error either:

Sub MyCleanup()

dim cbar as CommandBar

For Each cbar In CommandBars
If cbar.Name = "MyBar" Then
cbar.delete
MsgBox "Toolbar ""MyBar"" deleted."
Exit Sub
End If
Next cbar

MsgBox "Toolbar ""MyBar"" not found."

Exit Sub


Any help greatly appreciated!

-gk-
 

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

Similar Threads

Initializing a custom toolbar 3
Can't get Control.State to work 15
Custom Right Click--VBA? 4
Custom Toolbar Loading issue 2
VBE Toolbar Control 4
Toolbar Error 1
Custom Toolbar 2
Custom toolbars (not again!!!) 1

Back
Top