Link to home
Start Free TrialLog in
Avatar of gvilbis
gvilbis

asked on

How do i remove button from "Add-Ins"

I have on "add-Ins" menu button "My button" (see printscreen)
i would like to remove it from there

what should i have to change it the below code to remove it?

Thanks
Gvilbis


Public Sub Workbook_Open()

Stop
MacroName1 = "ThisWorkbook.RunComparingInventory"

    
    Set cbarMenu = Application.CommandBars

    ' First, look for button on the toolbar already.
    For Each cctlControl In cbarMenu("Standard").Controls
        With cctlControl
        
        If .Caption = "my button" Then
                .Delete
        End If
        
        If .Caption = "RunComparingInventory" Then
                .Delete
        End If
            
        
        End With
    Next cctlControl

    Set cctlControl1 = Application.CommandBars("Standard").Controls.Add(Type:=msoControlButton, Before:=1)
        
    With cctlControl1
        .Style = msoButtonCaption
        .Caption = "RunComparingInventory"
        .OnAction = MacroName1
        .TooltipText = "Run Comparing Inventory"
        .Enabled = True
    End With
End Sub

Open in new window

my-button.jpg
ASKER CERTIFIED SOLUTION
Avatar of dlmille
dlmille
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial