I\'m trying to automating some tests for an Excel add-in, which is in xll form. I have some problem in loading the xll. I\'m writing it in C# and my code looks like this:
A proper solution would be :
1- save the current directory with
string CurrentDir = Directory.GetCurrentDirectory()
2- then you use
Directory.SetCurrentDirectory(dirXll);
where dirXll is the location of your xll (cf GetExecutingAssembly()) .
3- Load your xll (RegisterXLL)
4- and finaly use CurrentDir to set the current directory back to its original location.
Don't forget to add all dlls that you xll is relyong on in the same folder as your xll.