I have an Excel VBA module calling a C# COM dll.
Sometimes, I get a type mismatch when I step through the debugger in VBA, when I initialize a COM object as follows.
If (IsEmpty(cm)) Then
Set cm = CreateObject("aimd.CMAdaptor")
End If
I can add a breakpoint in the VBA and add a watch to the cm variable, and see the type doesn't match what I instantiated. The type is for a property inside the object I'm trying to create. The object pointed to was clearly created by my "aimd.CMAdaptor" object I instantiated, I just don't get the root object I specify, only the child.
Since this is a COM object, I'm wondering if my updates could be using mismatched regasm data or something that causes it to look for the object in the wrong place. I am constantly rebuilding it for debugging, and adding it to an installer that calls regasm as a build action.