Automatically Loading Add-ins

Michael asked if there is a way to selectively load add-ins for specific worksheets. There is a way to do this, but it involves the use of macros attached to the Workbook module for the specific worksheets. Follow these general steps:

  1. Load the worksheet for which you want a specific add-in loaded.
  2. Press Alt+F11 to display the VBA Editor.
  3. Double-click on the “This Workbook” object in the Project Explorer. Excel opens a code window for This Workbook.
  4. Place the following macros in the code window:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
    AddIns("Add-In Name").Installed = False
End Sub
Private Sub Workbook_Open()
    AddIns("Add-In Name").Installed = True
End Sub
  1. In the code, change the name of the add-in (“Add-In Name”) to the real name of the add-in you want to use with the workbook.
  2. Close the VBA Editor.
  3. Save your workbook.

If you are not sure of the correct name for a particular add-in (see step 5), you can use the macro recorder to record the process of activating an add-in. That will show you the exact name you should use in the above macros.