Removing Plugins from the toolbar

  • Thread starter Thread starter John Riley
  • Start date Start date
J

John Riley

Hi;

I created a simple addin to automate some graphing and calculations we
required. Problem is I now have the tool in my toolbar about a dozen times,
how can I remove the options from my toolbar?


Thanks John
 
Reset your toolbar John

You can reset your toolbar to default
Right click on a toolbar and choose customize

Under Toolbars select the toolbar where your item is
and click on reset on the right

Use this for example to add a item and delete it
this will add a item to the tools menu named Ron de Bruin
When you click on it it will run the macro "TestMacro"

Sub MenuBar_Item_Item()
Dim MenuItem As CommandBarControl
MenuBar_Item_Item_Delete

Set MenuItem = Application.CommandBars.FindControl(, 30007) 'Tools menu
If MenuItem Is Nothing Then Exit Sub
With MenuItem.Controls.Add(msoControlButton, 1, , , True)
.Caption = "&Ron de Bruin"
.OnAction = ThisWorkbook.Name & "!TestMacro"
.BeginGroup = True
.Tag = "MenuItemTag"
End With
Set MenuItem = Nothing
End Sub

Sub MenuBar_Item_Item_Delete()
Dim MenuItem As CommandBarControl
Set MenuItem = Application.CommandBars.FindControl(Tag:="MenuItemTag")
If Not MenuItem Is Nothing Then
MenuItem.Delete
End If
Set MenuItem = Nothing
End Sub

Sub TestMacro()
MsgBox "Hi"
End Sub
 
Back
Top