Class AddIns (Excel VBA)
A collection of AddIn objects that represents all the add-ins available to Microsoft Excel, regardless of whether they're installed. To use a AddIns class variable it first needs to be instantiated, for example
Dim ais as AddIns
Set ais = AddIns
For Each
Here is an example of processing the AddIns items in a collection.
Dim adi As AddIn
For Each adi In AddIns
Next adi
Add
Adds a new add-in file to the list of add-ins. Returns an AddIn object.
This method does not install the new add-in. You must set the Installed property to install the add-in.
Dim strFilename As String: strFilename =
Dim adi As AddIn
Set adi = AddIns.Add(Filename:=strFilename)
Arguments
The following argument is required
Filename (String) - The name of the file that contains the add-in or the ProgID of the automation add-in that you want to add to the list in the add-in manager.
Optional arguments
The following argument is optional
CopyFile (Boolean) - Ignored if the add-in file is on a hard disk. True to copy the add-in to your hard disk, if the add-in is on a removable medium (such as a compact disc). False to have the add-in remain on the removable medium. If this argument is omitted, Microsoft Excel displays a dialog box and asks you to choose.
Count
Returns a Long value that represents the number of objects in the collection.
Dim lngCount As Long
lngCount = AddIns.Count
Item
Returns a single object from a collection.
Item (Index)
Index: The name or index number of the object.
Dim adiItem As AddIn
Set adiItem = AddIns(Index:="Analysis ToolPak")