0

I have an excel COM add-in that have quick access toolbar with element that i can execute by clicking on it. Right now I want to write VBA macro that executes this element multiple times. I am trying to get to this add-in elements with this lines:

Dim addinModule As Object Set addinModule = Application.COMAddIns.Item("MyExcelAddin").Object But all I can get is error that says "Run-time Error 9: Subscript out of range"

I can't add it in tools-> references, in COM-Addins section in developer mode it is loaded.

Regards

Andrzej T
  • 21
  • 1
  • I've bumped into this using VSTO, but fundamentally the .Net Excel.Interop is the same as the VBA Object Model underneath. Whats the error message? I think @Profex might have solved it but if that doesn't work can you try with Admin: https://stackoverflow.com/questions/10875278/vsto-add-ins-comaddins-and-requestcomaddinautomationservice – Jeremy Thompson Feb 13 '19 at 01:51

1 Answers1

1

You have to use the progID not the description.

For a list of all the COM add-ins running just run:

Dim i As Long
For i = 1 To Application.COMAddIns.Count
    With Application.COMAddIns(i)
        Debug.Print .progID & "  :  " & .Description
    End With
Next

If it's loaded, you should see it in the list.

Profex
  • 1,370
  • 8
  • 20