mpdillon
Member
I am trying to create a Com Class dll in VB.Net 2008 which will be accessable from VBA and VB6.
I have choosen Class Library.
Then added a New COM Class
I deleted the original Class1 .vb
I added my code.
I added <Assembly: ClassInterface(ClassInterfaceType.AutoDual)> to my Com Class. It already had a ComClass entry
I made sure "Register for COM interopp" was checked in the project>properties>Compile screen.
After a build I move the .dll, .tlb and the snk to a server.
I would like to leave the dll on the server rather than install it on every workstation (but I could put it on every workstation if that is my problem).
Since I am testing on the server I use RegAsm to register the assembly.
I have tried both
regasm M:\email\sendemail.dll /codebase M:\email\sendemail.dll
and
regasm M:\email\sendemail.dll /tlb:M:\email\sendemail.tlb /codebase M:\email\sendemail.dll
The second one overwrites the .tlb created by visual studio.
I even dragged the .dll into the C:\windows\assembly directory and unregistered the assembly.
Regardless of what I have tried, I cannot add the dll as a reference in Excel 2003.
The message I receive is:
"Can't add a refernce to the specied file"
I can add the .tld file. When I add the .tlb file I can see the properties and methods. But when I run the code I get ActiveX component cannot create object. (this is the error message I get when using the VS version of the.tlb. The message is different when I use the .tlb which is generated by the RegAsm.)
It can't be this difficult. What am I missing???
thanks,
pat
I have choosen Class Library.
Then added a New COM Class
I deleted the original Class1 .vb
I added my code.
I added <Assembly: ClassInterface(ClassInterfaceType.AutoDual)> to my Com Class. It already had a ComClass entry
I made sure "Register for COM interopp" was checked in the project>properties>Compile screen.
After a build I move the .dll, .tlb and the snk to a server.
I would like to leave the dll on the server rather than install it on every workstation (but I could put it on every workstation if that is my problem).
Since I am testing on the server I use RegAsm to register the assembly.
I have tried both
regasm M:\email\sendemail.dll /codebase M:\email\sendemail.dll
and
regasm M:\email\sendemail.dll /tlb:M:\email\sendemail.tlb /codebase M:\email\sendemail.dll
The second one overwrites the .tlb created by visual studio.
I even dragged the .dll into the C:\windows\assembly directory and unregistered the assembly.
Regardless of what I have tried, I cannot add the dll as a reference in Excel 2003.
The message I receive is:
"Can't add a refernce to the specied file"
I can add the .tld file. When I add the .tlb file I can see the properties and methods. But when I run the code I get ActiveX component cannot create object. (this is the error message I get when using the VS version of the.tlb. The message is different when I use the .tlb which is generated by the RegAsm.)
It can't be this difficult. What am I missing???
thanks,
pat