Ieuan,
The reason for this is that you need to cast it to the interface that
exposes the functionality. VB6 mucked around with COM, exposing interfaces
and trying to pass them off as classes. It's the kind of thing that causes
this mess in the first place.
Look for an interface named _Collection in the VBA namespace, and cast
to an instance of that. You should be able to access all the functionality
that you need once your CollectionClass is cast to that.
CollectionClass is a managed wrapper created by when you add the
reference which you can use to create the class instance (since you can't
create an interface).
--
- Nicholas Paldino [.NET/C# MVP]
-
(E-Mail Removed)
"Ieuan" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Nicholas,
>
> Thanks for the reply.
>
> I've put in a reference to the dll you mentioned - this brings in a few
> things into the references area including the VBA one you mention.
>
> I then try to cast a VBA.CollectionClass passed back from my dll into a
> VBA.Collection. This works correctly but only so far as it shows the
> converted object I'm trying to look at as an object of type
> VBA.CollectionClass and I can't get any further into the object. I'm
> looking at this through the locals window.
>
> If the object is a simple one dimensional array then I can manage a
> foreach object in VBACollection and put the object into an arraylist.
>
> However, I don't know what type most objects are - they could be an
> array, an array of an array etc...
> Any other suggestions would be most welcommed.
>
> Ieuan
>