简体   繁体   中英

Refreshing the Excel Addin List

I am trying to check with VBA if an Excel Addin is installed. However, the Addins list (Application.AddIns) remains empty unless I go into the Excel interface and list the Addins, then Application.Addins will populate with all the addins.

I tried using "Application.VBE.AddIns.Update" and "Excel.Application.COMAddIns.Update" but I get the same results.

Using Windows 10, Excel 2007

The AddIns are a collection. Try to view them like this:

Sub TestMe()

    Dim cnt         As Long
    For cnt = 1 To AddIns.Count
        Debug.Print AddIns(cnt).Name
        Debug.Print AddIns(cnt).Installed
    Next cnt

End Sub

Then you will see what you get. This is the standard:

ANALYS32.XLL
True
ATPVBAEN.XLAM
False
SOLVER.XLAM
True

Office differentiates between add-ins and COM add-ins. They exist in separate collections. To enumerate you COM add-ins, do the following:

Dim ai As COMAddIn
For Each ai in Application.COMAddIns
    Debug.Print ai.Description
Next ai

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM