By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,900 Members | 1,367 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,900 IT Pros & Developers. It's quick & easy.

VBA.Collection in C#

P: n/a
Hi, im using a vb dll in my project and i need to access one object within
it of type VBA.Collection, somebody can give me a hand to do this? i tried
to cast to an array, object[] etc. but seems im in the wrong way...

Thanks In Advance
Ariel Gimenez
Nov 15 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Ariel,

If you are using a VB.NET dll, then you can set a reference to
Microsoft.VisualBasic.dll and use the Collection class that is in that
assembly in the same manner as you would in VB. If this is the case, then
you probably should change the code so that it uses an ArrayList, or a
Hashtable (depending on whether or not you use the keys in the Collection).

If this is a Collection from a VB6 dll used in COM interop, then you
will have to take the collection and manually populate an ArrayList or a
Hashtable yourself, depending on your needs.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ariel Gimenez" <arielgimenez@--sacar--esto--yahoo.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi, im using a vb dll in my project and i need to access one object within
it of type VBA.Collection, somebody can give me a hand to do this? i tried
to cast to an array, object[] etc. but seems im in the wrong way...

Thanks In Advance
Ariel Gimenez

Nov 15 '05 #2

P: n/a
Thanks Nicholas!!!!

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:%2****************@TK2MSFTNGP10.phx.gbl...
Ariel,

If you are using a VB.NET dll, then you can set a reference to
Microsoft.VisualBasic.dll and use the Collection class that is in that
assembly in the same manner as you would in VB. If this is the case, then
you probably should change the code so that it uses an ArrayList, or a
Hashtable (depending on whether or not you use the keys in the Collection).
If this is a Collection from a VB6 dll used in COM interop, then you
will have to take the collection and manually populate an ArrayList or a
Hashtable yourself, depending on your needs.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ariel Gimenez" <arielgimenez@--sacar--esto--yahoo.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi, im using a vb dll in my project and i need to access one object within it of type VBA.Collection, somebody can give me a hand to do this? i tried to cast to an array, object[] etc. but seems im in the wrong way...

Thanks In Advance
Ariel Gimenez


Nov 15 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.