View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
hbj hbj is offline
external usenet poster
 
Posts: 35
Default Installing and loading AddIns in multiuser environment

On Thursday, March 15, 2018 at 6:07:51 PM UTC+2, hbj wrote:
I have a project using an own Addin MyUdf.xlam. The project and the Addin locate in Dropbox and are used by three different users: HBJ, KOKKO and AIB. I have to install the AddIn and be sure that the most current Addin version is available at any time for all users. Both the application and the Addin are in Dropbox folders, the name of which is related to the user name and therefore different for all users. The procedures in the AddIn work perfectly but the functions make me crazy.
I use an AddIn function CheckDigit(parameter) . If user KOKKO opens a file recently modified and saved by user HBJ, the call to the function CheckDigit() looks something like €œC:\USERS\HBJ\DROPBOX\COMMON\MyUdf!CheckDigit(pa rameter)€, and result is #VALUE!.

I thought I could, when I open the project, copy the Addin to the local Addin folder and use it locally €“ not the version in Dropbox, but that folder is protected.
Below how I load the AddIn in WorkBook.Open()
Set myAddIn = AddIns.Add(Filename:=cFile)
myAddIn.Installed = True

€˜Load known XLAM
For Each myAddIn In AddIns
If myAddIn.Name = "MyUdf.xlam" Then
myAddIn.Installed = False
myAddIn.Installed = True
End If
Next
I need help on how to install and load my AddIn in that environment.

/HÃ¥kan


As far as I understood, every user has to explicitly execute the script to activate the AddIn, when the addIn has changed. If so, this is not what I require of my project.
Is it quite impossible to handle AddIn installation and updates automatically in WorkBook.Open() €“ and remove it on closing the application.
I decided to solve this problem the quick-and-dirty way: I add to the WorkBook.Open Substitute the Dropbox folder containing the AddIn to i.e S:. After this, my application will find the Addin in S:
(SUBST S: C:\USERS\DROPBOX\KOKKO\COMMON)

/HÃ¥kan