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.
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

ivo.derado2 reputationPosted Feb 23, 2005, 8:47 PM EST
Johan Roman3 reputationPosted Feb 13, 2008, 5:06 AM EST
See:
http://www.c-sharpcorner.com/Forums/ShowMessages.aspx?ThreadID=38333
Mathieu Lafontaine2 reputationPosted Feb 13, 2008, 8:38 AM EST
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...