We help IT Professionals succeed at work.

How do i remove button from "Add-Ins"

gvilbis
gvilbis asked
on
191 Views
Last Modified: 2012-05-11
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
Comment
Watch Question

Most Valuable Expert 2012
Top Expert 2012
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.