I have the following code to check if a required addin is installed/available before calling scripts within that Addin from the current context:
Function IsAddinEnabled(addinName as string) As Boolean
IsAddinEnabled = True
Dim myAddin As addin
On Error GoTo NotExists
Set myAddin = Application.AddIns2(addinName)
If myAddin.IsOpen = False Then ' this logic is my workaround
myAddin.Installed = False 'uninstall
myAddin.Installed = True ' install to "Open" the addin
Else
myAddin.Installed = True 'redundant
End If
Exit Function
NotExists:
IsAddinEnabled = False
End Function
The problem arises when:
myAddin.IsOpen = false
I had to add this logic to reinstall the addin. It's a slight nuisance/slow down to uninstall and reinstall the addin. Is there a way to force and Addin to "open" without re-installing the addin?
Per @Charles Williams
This is the method I've used:
A simpler way is to check if the addin exists in the workbooks collection.
If it does not you can open it as though it was a workbook assuming you know the path.
(don't need to bother with the addins collection)