ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to permanently delete a custom toolbar (https://www.excelbanter.com/excel-programming/304424-how-permanently-delete-custom-toolbar.html)

39N95W[_2_]

How to permanently delete a custom toolbar
 
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-



Ron de Bruin

How to permanently delete a custom toolbar
 
Hi 39N95W (nice name)

You can find your answer in this article and a lot more

http://support.microsoft.com/default...02&Product=xlw
How to customize menus and menu bars in Excel

--
Regards Ron de Bruin
http://www.rondebruin.nl


"39N95W" wrote in message ...
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-






All times are GMT +1. The time now is 12:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com