Good evening everybody,
For me, the night is on (11:30 PM) !
But not for all people around the world (America for example).
So I hope an answer for tomorow morning,it would be helpfull :) ... if you want and you can !!
I built a C# DLL using ExcelDna. This DLL containts a form which is fully interfaced with the application Excel.
This DLL works fine. I can exchange information between the Form and Excel, managing shapes and other data.
As the ExcelDna's documentation says, I have those files in my directory (
see pict1.jpg).
In the Excel file, the ThisWorkBook_Open() function contains this code :
Dim oAddIn As AddIn
Set oAddIn = Application.AddIns.Add(Filename:=ThisWorkbook.Path & "\ClassLibrary2.xll")
oAddIn.Installed = True
Application.Run "OuvrirFormulaire"
It works fine in the build directory.
BUT, I want to give those files to another collegue.
To simulate that, I when I MOVE the files to another directory, Excel sends a message as below (Error 1004 :
see pict2.jpg).
Excel can't find the XLL file ... because Excel has memorizes the previous location for the XLL file.
To solve that, I need to go in the add-in menu in Excel, choose "ClassLibrary2" option, receive a message from Excel which says that It can't find the XLL file and propose me to delete this entry in the list. I clic OK.
I launch my Excel file another time, and this time, Excel found the correct XLL file location ... and It works fine.
QUESTION : How can I manage this distribution without any problem for me when I want to change the directory, or for another end-user ??
Thanks a lot for your help and experience !!
Best regard.
Emmanuel