Add in installed and referenced

前端 未结 3 783
萌比男神i
萌比男神i 2020-12-21 11:38

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 Refernc

3条回答
  •  礼貌的吻别
    2020-12-21 12:17

    Sub Sample()
        Dim wbAddin As Workbook
    
        On Error Resume Next
        Set wbAddin = Workbooks(AddIns("My Addin").Name)
    
        If Err.Number <> 0 Then
            On Error GoTo 0
            'Set wbAddin = Workbooks.Open(AddIns("My Addin").FullName)
            Debug.Print "Not Referenced"
        Else
            Debug.Print "Referenced"
        End If
    End Sub
    

提交回复
热议问题