DLL install - File not found

I have created a DLL for use with Microsoft Excel (this is converted into a TLB for that purpose). On my machine, this works fine. However, when testing on another machine, it gives the following message when a class is instantiated: "Automation error: The system cannot find the file specified".

Looking at the references tab in project properties, some of the references map to paths in c:\windows\assembly\GAC, but two of them (scripting runtime and XML 4.0) map to c:\documents and settings\(my user name)\Visual Studio 2005\....., which clearly isn't good. I have tried to change the "Copy Local" property to False, but it still does not let me change the reference path.

What am I doing wrong? I'd like a solution that would work for non-savvy users.

Thanks,

Steve

[831 byte] By [SteveBerman] at [2008-1-10]
# 1

Hi Steve,

Based on your post, my understanding of your question is that when you call a .Net library directly from Excel, it shows "Automation error". First we need to use the regasm.exe to register this .Net assembly in the client computer in this scenario. Note that you can unregister an assembly with the /u option of regasm. For more detail on this see http://msdn2.microsoft.com/en-us/library/tzat5yw6(vs.80).aspx.

Second one problem occurs commonly. It is that Excel can get confused about which version of the .NET Framework to load if you have more than one version installed in this scenario. If this happens you will get an automation error when you try to instantiate .NET objects at runtime from Excel. The .NET types will appear correctly in the Excel object browser. For more information about the workaroud of this problem. Please see this article: A Beginner’s Guide to calling a .NET Library from Excel. Hope this helps.

Best regards,

Riquel.

RiquelDong–MSFT at 2007-10-3 > top of Msdn Tech,Visual Basic,Visual Basic Language...