I have a library written in C# that uses standard .NET framework libraries (System, System.Windows.Forms). This library is COMVisible as well as its classes, I just have two classes: - TestClass (a class with one method) - TestForm (an empty form)
I registered the assembly as suggested here: C# COM DLL: do I use Regasm, or Regsvr32?
Then I went to my Excel Add-In and added a reference to the generated .TLB file.
I am able to create an instance of my "TestClass" and invoke its method without any problem, but when I try to create an instance of my "TestForm" it shows me this error:
Run-time error '-2147024894 (80070002)':
Automation error
The system cannot find the file specified.
According to the issues I saw when trying to get the class working, the problem is that one of the dependencies (I'm guessing System.Windows.Forms) is not being found by Excel.
How do I open a Form written in .NET from my 64bit Office add-in?
Thanks in advance