Class AddIn (Excel VBA)

The class AddIn represents a single add-in, either installed or not installed.

The main procedures of class AddIn are AddIns.Add and AddIns2.Add

Set

To use a AddIn class variable it first needs to be instantiated, for example

Dim strFilename As String: strFilename = 
Dim adi As AddIn
Set adi = Application.AddIns.Add(Filename:=strFilename)

The following procedures can be used to set variables of type AddIn: AddIns.Item, AddIns.Add, AddIns2.Item, AddIns2.Add, Application.AddIns and Application.AddIns2

For Each

Here is an example of processing the AddIn items in a collection.

Dim adiAddIn As AddIn
For Each adiAddIn In Application.AddIns
	
Next adiAddIn

Themes

The following procedures in this class have been grouped together and are described on a separate theme page

Add with its procedures AddIns.Add and AddIns2.Add

Properties

CLSID returns a read-only unique identifier, or CLSID, identifying an object as a String.

FullName returns the name of the object, including its path on disk, as a string.

For Each a In AddIns 
 MsgBox a.FullName 
Next a

Installed true if the add-in is installed or to install the add-in; False if the add-in is uninstalled or to uninstall the add-in.

Set a = AddIns("Solver Add-In") 
If a.Installed = True Then 
 MsgBox "The Solver add-in is installed" 
Else 
 MsgBox "The Solver add-in is not installed" 
End If

IsOpen returns True if the add-in is currently open.

Name returns a String value that represents the name of the object.

Parent returns the parent object for the specified object. Read-only.

Path returns a String value that represents the complete path to the Add-in, excluding the final separator and name of the Add-in.

progID returns the programmatic identifiers for the object.

rw = 0 
For Each o in Worksheets(1).OLEObjects 
 With Worksheets(2) 
 rw = rw + 1 
 .cells(rw, 1).Value = o.ProgId 
 End With 
Next

AddIns.Count returns a Long value that represents the number of objects in the collection.

AddIns.Item returns a single object from a collection.

If ThisWorkbook.Application.AddIns.Item("Analysis ToolPak").Installed = True Then 
 MsgBox "Analysis ToolPak add-in is installed" 
Else 
 MsgBox "Analysis ToolPak add-in is not installed" 
End If

AddIns.Parent returns the parent object for the specified object. Read-only.

AddIns2.Count returns a Long value that represents the number of objects in the collection.

AddIns2.Item returns a single object from a collection.

If ThisWorkbook.Application.AddIns2.Item("Analysis ToolPak").Installed = True Then 
 MsgBox "Analysis ToolPak add-in is installed" 
Else 
 MsgBox "Analysis ToolPak add-in is not installed" 
End If

AddIns2.Parent returns the parent object for the specified object. Read-only.