views:

17

answers:

0

I have a base abstract class MyClass, and it has an interface IMyClass. I have 2 other classes (MyClassA, and MyClassB) that inherit from MyClass and include the IMyClass Interface.

I have a fourth class (MyList) that inherits from List<IMyClass> and it has an interface that has a method

Add(IMyClass value);

All classes have been exposed to COM.

I reference the .net dll in my Excel document. I am able to instantiate instances of MyClassA, MyClassB and MyList.

If I try to pass my instance of MyClassA or MyClassB to the Add method from within an excel VBA module, I get an error type mismatch.

I am unsure if this is an issue with how I exposed my classes to COM, how VBA handles implicit casting, or if I'm just writing bad CBA code.

Suggestions appreciated...