Problem with calling managed code dll from Excel
Hello!
I try to use an assembly I created in C# in Excel.
I use the commands csc, tlbexp & regasm to create the necessary files. I can use the library without any problem on my computer.
When I try to make the assembly work on another computer, I copy the dll and tlb file to the other machine and run regasm there. I can add the reference to the file out of Excel, but when I want to use my object in the VBA-code I get the Error message
"Run-time error '-2147024894 (80070002)'
Automation Error
The system cannot find the file specified"
Does anyone know what to do?
Thanks in advance!
w.
Mathieu LafontainePosted Feb 13, 2008, 1:38 PM
Hi! I've had a similar problem. It seems Excel will only load one version of the .Net framework. Therefore, it might not use the correct version to execute your assembly. I added an Excel.exe.config file where Excel.exe resides. I used an element in the Xml file to specify the framework version of my .Net assembly. Like this:
I don't know if it'll solve your problem but it helped for mine...
Johan RomanPosted Feb 13, 2008, 10:06 AM
See:
http://www.c-sharpcorner.com/Forums/ShowMessages.aspx?ThreadID=38333
ivo.deradoPosted Feb 24, 2005, 1:47 AM