I have an excel add-in that I want to store in a shared sharepoint folder so that the end user's workbook downloads the latest version add-in when they open their workbook. My problem lies in how to get the path to the file. I'm not including all of the code because I believe only this part is relevant.
Sample made up source file path to sharepoint:
https://groups.blah.com/:x:/r/Sites/mydept/shared%20Documents/Test/MyAddIn.xlam?csf=1&web=1&e=5vYskg
I tried a couple of options
Try to copy the file to the user AddIns folder:
FileCopy sourcePath, Application.UserLibraryPath & "MyAddIn.xlam"
Results in "Bad file name or number" error
Use the Add method:
Addins.Add sourcePath, False
Results in "Add method of AddIns class failed" error
I'm not too knowledgeable on add-ins and sharepoint. We have sharepoint and onedrive to use as our network options.
Also, a secondary question is once an add-in is installed, is it best practice to uninstall it when the user closes their workbook? I ask because I only want the add-in to run on a particular workbook and not whenever any workbook is opened. My best guess was to uninstall on workbook close
I solved it by storing the add-in on the sharepoint site and sending users a link to the file on the sharepoint site that they can connect to their onedrive by clicking the "add shortcut to onedrive." Once added, I can get the path to their onedrive my documents folder that has the shared link and install from there