A VBA code to list all add-ins in Excel


Microsoft Excel can receive additional commands and capabilities through the use of add-ins. Because Excel does not make its add-ins immediately accessible by default, you will need to first install and then (in certain situations) activate the add-ins in question before you can make use of them. A group of AddIn objects that collectively represents all of the add-ins that can be used with Microsoft Excel, regardless of whether or not the add-ins have been installed.

We can list all add-ins in an Excel sheet through a VBA code. So let’s see the VBA code and how it works in this tutorial.

Step 1 

Open an Excel sheet and press Alt and F11 key (Alt+F11) to open Microsoft Visual Basic for Application windows. See the below given image.

Step 2 

After that, select Insert > Module from the menu bar to bring up the popup Module window. See the following image.

Step 3 

After opening the Module window, type the following VBA code in it.

Public Sub ListAddins()
Dim xWSh As Worksheet
Dim xWB As Workbook
Dim xAddin As AddIn
Dim xCOMAddin As COMAddIn
Dim xFA, xFCA As Integer
Dim xI As Integer
Dim xStr As String 

On Error Resume Next 
Application.DisplayAlerts = False
xStr = "Addins List"
Set xWB = Application.ActiveWorkbook
Set xWSh = xWB.Worksheets.Item(xStr)
If Not xWSh Is Nothing Then
   xWSh.Delete
End If
Set xWSh = xWB.Worksheets.Add
xWSh.Name = xStr
xWSh.Range("A1").Value = "Name"
xWSh.Range("B1").Value = "FullName"
xWSh.Range("C1").Value = "Installed"
For xFA = 1 To Application.AddIns.Count
   Set xAddin = Application.AddIns(xFA)
   xI = xFA + 1
   Range("A" & xI).Value = xAddin.Name
   Range("B" & xI).Value = xAddin.FullName
   Range("C" & xI).Value = xAddin.Installed
Next xFA
xFA = (xFA + 2)
xWSh.Range("A" & xFA).Value = "Description"
xWSh.Range("B" & xFA).Value = "progID"
xWSh.Range("C" & xFA).Value = "Connect"
For xFCA = 1 To Application.COMAddIns.Count
   xI = xFCA + xFA 
   Set xCOMAddin = Application.COMAddIns(xFCA)
   Range("A" & xI).Value = xCOMAddin.Description
   Range("B" & xI).Value = xCOMAddin.progID
   Range("C" & xI).Value = xCOMAddin.Connect
Next xFCA
Application.DisplayAlerts = True
End Sub

See the following image to understand how it's done.

Step 4 

After adding the VBA code run the code by pressing F5 or click Run. See the following image.

You can save the above VBA code. To save the VBA code, go to "File > Save".

Step 5 

Now go to the excel sheet which was created. We can see here the list of all add-ins installed. See the following image.


Updated on: 10-Sep-2022

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements