I need to enable COM addins through VBA. The addins already exists under COM addins, but become unchecked when Excel crashes.
Sub hyp()
Dim objAddIn As O
Note: Please see the comment of BigBen below - this approach may not always work as the indexer does not always coincide with the description. If you need to search by description, then the Excel Developers answer is probably applicable (though I haven't personally tried it or needed it).
A simpler alternative to the answer of Excel Developers that worked for me is to index the com add in directly by its string name instead of looping through the com add ins using an integer index and comparing to the description. In particular, this code worked for me (I've included a connect and disconnect version):
Public Sub Connect_COM_AddIn(Name As String)
Application.COMAddIns(Name).Connect = True
End Sub
Public Sub Disconnect_COM_AddIn(Name As String)
Application.COMAddIns(Name).Connect = False
End Sub