Excel .NET COM - Automation error. The system cannot find the file specified

前端 未结 5 821
名媛妹妹
名媛妹妹 2021-02-12 11:43

I have a .NET 2.0 COM object that\'s used by VBA in Excel. It works fine on my dev machine, but when trying to use it on a clean VM workstation I get this error:

Automat

5条回答
  •  情书的邮戳
    2021-02-12 12:38

    I received this "Automation error. The system cannot find the file specified" error after I had created a .NET .dll (v4.0) with the intention of using it in a VB6 application (decorated my class with "ClassInterface" and "ComVisible" attributes, methods with "ComVisible").

    I ran "regasm.exe -tlb C:\PathTo\MyDll.dll" but received the above error after adding the .tlb file as a reference in my VB6 application and running/debugging it. Only after adding the "-codebase" parameter to the regasm.exe call and re-adding the .tlb reference did the error get resolved.

    Just thought I'd share my experience.

提交回复
热议问题