I'm working on a project that uses some older VB6 COM objects. One of
the classes returns a Collection object, which I am having trouble
reading in C#. Can someone point me in the right direction here...
ComObject objItemType = new ComObject("Items");
args = new object[0];
VBA.Collection coll = objItemType.doMethod("GetTypes",args); // This
method is returning a collection
Now, I know the method call is working OK and actually returning data,
because the Count property of coll is set correctly. But I cannot get
at the individual items, which in this case is another VB6 COM object.
Everything I've tried (foreach, indexer, etc.) either fails at compile
or run time.
What is the correct way to access these objects in the collection???
Is VBA.Collection not the correct object? Do I need to cast it to
something else? This is driving me crazy.