Trying to install a custom add-in, the add-in tab not appearing Excel 2007

some_evil

New Member
Joined
Feb 19, 2014
Messages
33
Office Version
  1. 365
Platform
  1. Windows
Hi All,

Our company has a little bit of VBA that we use in house on our local machines running Excel 2007, this code has been passed around the office and has been successfully deployed on about a dozen PC's, but for some reason when we run this code, it is not 'enabling' and displaying the Add-In tab in the Ribbon. See Screen shot of a successfully installation on someone else PC:

Add-In.jpg


So when I run the same code on my PC, it displays the message box to say the script has run, but nothing actually appears.

I can confirm that I click the MS Button in the top left, go to Excel Options | Add-Ins | Press the Go button at the bottom and it shows the add-in as being checked and available.

I have also gone into Excel Options | Trust Center | Add-ins and can confirm that both 'Require application add ins to be signed by trusted publisher' and Disable All application add-ins are both UNCHECKED.

I am unsure what else to look into to get this working?

Any tips?

Code:
Sub AddMenu()


    Dim cMenu1 As CommandBarControl
    Dim cbMainMenuBar As CommandBar
    Dim iHelpMenu As Integer
    Dim cbcCutomMenu As CommandBarControl
    
    On Error Resume Next
    
    Application.CommandBars("Worksheet Menu Bar").Controls("&Conquest Automate").Delete
    
    Set cbMainMenuBar = Application.CommandBars("Worksheet Menu Bar")
    iHelpMenu = cbMainMenuBar.Controls("Help").Index
    Set cbcCutomMenu = cbMainMenuBar.Controls.Add(Type:=msoControlPopup, Before:=iHelpMenu)
    cbcCutomMenu.Caption = "&Conquest Automate"
    
    With cbcCutomMenu.Controls.Add(Type:=msoControlButton)
        .Caption = "Sewer Mains"
        .OnAction = "SewerMainsRunAll"
        .FaceId = 6850
    End With
    
    With cbcCutomMenu.Controls.Add(Type:=msoControlButton)
        .Caption = "Sewer Structures"
        .OnAction = "SewerStructuresRunAll"
        .FaceId = 6854
    End With
    
    With cbcCutomMenu.Controls.Add(Type:=msoControlButton)
        .Caption = "Stormwater Pipes"
        .OnAction = "SWPipesRunAll"
        .FaceId = 6859
    End With
    
    With cbcCutomMenu.Controls.Add(Type:=msoControlButton)
        .Caption = "Stormwater Structures"
        .OnAction = "SWStructuresRunAll"
        .FaceId = 6852
    End With
               
    With cbcCutomMenu.Controls.Add(Type:=msoControlButton)
        .Caption = "Water Mains"
        .OnAction = "WaterPipesRunAll"
        .FaceId = 6855
    End With
    
    MsgBox "Installer has run all the way through"

On Error GoTo 0

End Sub
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
With persistence, and the assistance of this thread I was able to re-write the above code and successfully install the add-in onto my PC. I did not have to change any excel or PC settings at all, it was simply running the below code that worked.

Code:
Sub AddMenu()

'25/08/2014


   Set HelpMenu = CommandBars(1).FindControl(ID:=30010)
    
    If HelpMenu Is Nothing Then
'       Add the menu to the end
        Set ConqAuto = CommandBars(1).Controls.Add _
          (Type:=msoControlPopup, temporary:=True)
    Else
'      Add the menu before Help
        Set ConqAuto = CommandBars(1).Controls.Add _
          (Type:=msoControlPopup, Before:=HelpMenu.Index, temporary:=True)
    End If


'   Add a caption for the menu
    ConqAuto.Caption = "&Conquest Automation"
    
'   ADD MENU ITEMS BELOW
    With ConqAuto.Controls.Add(Type:=msoControlButton)
        .Caption = "Sewer Mains"
        .OnAction = "SewerMainsRunAll"
        .FaceId = 6850
    End With
    
    With ConqAuto.Controls.Add(Type:=msoControlButton)
        .Caption = "Sewer Structures"
        .OnAction = "SewerStructuresRunAll"
        .FaceId = 6854
    End With
    
    With ConqAuto.Controls.Add(Type:=msoControlButton)
        .Caption = "Stormwater Pipes"
        .OnAction = "SWPipesRunAll"
        .FaceId = 6859
    End With
    
    With ConqAuto.Controls.Add(Type:=msoControlButton)
        .Caption = "Stormwater Structures"
        .OnAction = "SWStructuresRunAll"
        .FaceId = 6852
    End With
               
    With ConqAuto.Controls.Add(Type:=msoControlButton)
        .Caption = "Water Mains"
        .OnAction = "WaterPipesRunAll"
        .FaceId = 6855
    End With
    
    MsgBox "Installer has run all the way through"
    
End Sub
 
Upvote 0

Forum statistics

Threads
1,217,019
Messages
6,134,054
Members
449,857
Latest member
caracal

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top