When you create Excel Addins and distribute them to a lot of users, normally the users must copy the Add-in files into the “Addins” folder from the path: “C:Usersuser_nameAppDataRoamingMicrosoftAddIns” and after that to activate the Addin from Excel:
Because these steps take time, the users must follow them everytime when you send a new version of the Addin and sometimes they forget what to do, I created a VBA code which installs and activates automatically a specified Addin file.
How it works ?
- Create a new folder with the INSTALL.xlsm file (which can be downloaded at the end of this post) and your Addin.xlam file. (the files must be in the same folder !):
- Open the INSTALL.xlsm file and in the VBA Developer- Module1, install_add_in() procedure change the fileName variable assignment with the name of your addin file:
- Save the file, create a *.zip/*.rar archive with the folder and send it to all users.
- The users will now Install and activate automatically the Addin by opening the INSTALL.xlsm file and just pressing the “INSTALL ADDIN” button.
- If an old version of the Addin already exists in the Addins folder, the user will be asked to confirm if he wants to replace it with the new file.
–> Using this code the users will not have to remember where to copy the files and how to activate the Addins.
Download the INSTALL.xlsm file: