Managing Add-ins for Excel
- 0 0
-
shares
List all Addins into a sheet ( COM and XLAM )
Copy and paste the below into a module , when run it'll list all active addins into a table.
This can be a foundation to build other tools, like version testing scripts to ensure the latest instance is loaded for a user. If you have a network directory or sharepoint folder, these can be checked also.
As an example - the following sub will loop through all referenced Xlam addins in the application, and search for match vs partial match.
So for example, I have toolbars versioned by date, the sub will search to enable the latest version ( this can be hard coded, or loaded from an SQL database or network/sharepoint file ), and disable older versions that match the name but not the date.
The code below checks if the latest version ( MyAddin string ) , and if not 'installed', sets it to 'installed', and those that are partial matching ( PartMatchLeft ) are uninstalled.
This is equivalent to checking/unchecking the tickboxes on the add-ins dialogue. Below Toolbarplaceholder.xlam has been enabled, Example-Totals-C.xlam and Latest_Function.xlam are disabled ( and will not be available as macros to be run by the user )
As a usage example -say you have the following versions
ToolBar(25-JAN-17).xlam
ToolBar(06-FEB-17).xlam
ToolBar(04-MAY-17).xlam
You'd perform the replace like so :
Where it'll unload/uninstall anything that begins with 'ToolBar' , and load/install the latest.
This variable could be sourced programmatically from a database call, so the toolbar checked/unloaded dynamically.