I have a class library written in .Net that I would like to make available to VB6/VBA. What I tried did not work (obviously as I am asking this question). Here is what I did:
- I Created a Class Library Project in Visual Studio 2010 Express and put the code in a Class Module.
- I opened the project properties and went to "Assembly Information" and checked "Make COM Visible".
- I went to "Advanced Compile" options and targeted .Net 2.0 (it's very simple code).
- I then removed all references expect for "System".
- I built the project (no warnings or errors) and copied the DLL out of the Bin folder into C:WindowsSystem32
- I ran RegSvr32 to register the DLL and got the error:
The module "MyDll.dll" was loaded but the entry-point DLLRegisterServer was not found.
Make sure that "MyDll.dll is a valid DLL or OCX file and then try again.
Clearly my first attempt was a bit naive. Could someone offer guidance?
See Question&Answers more detail:os