I want to check if addin is installed and is referenced. The below code checks for add in is installed or not. How can i check if its referenced in excel.
By Refernced i mean is Tools > Addins > Addins Dailog box > If addins is installed > check if a addin with particular name is checked.
I would like preferably without any loop.
Sub Demo()
Dim b As Boolean
b = CheckAddin("Solver add-in")
MsgBox "Solver is " & IIf(b, "", "not ") & "installed"
End Sub
Function CheckAddin(s As String) As Boolean
Dim x As Variant
On Error Resume Next
x = AddIns(s).Installed
On Error Goto 0
If IsEmpty(x) Then
CheckAddin = False
Else
CheckAddin = True
End If
End Function
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…