I am in the middle of (trying) to create a Class Library available for use in VB6/VBA. With some assistance received here I have now done the following:
- Created a Class Library Project in Visual Studio 2010 Express and put the code in a Class Module.
- Learned I needed this wonderful thing called an "Interface"... Made one of those:)
- 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).
- Removed all references expect for "System".
- Built the project (no warnings or errors) and copied the DLL out of the Bin folder into C:\Windows\System32\
- Ran RegAsm /tlb. Everything seemes just fine.
I popped open excel to run a quickie test and the TLB is available but I have two problems:
- I can see both the class and the interface in the Object Browser/Intellisense.
- When I try to create an instance of either object (
Set obj = New MyObj
)I get the error:
Automation error The system cannot find the file specified.
I can set a reference to the Object and the Intellisense can see it, I just get that error when I actually try to create the Object. Did I miss a step?