Why VBA.Collection and Not VB.Collection? 
Author Message
 Why VBA.Collection and Not VB.Collection?

I noticed some code which was written as VBA.Collection to
declare a New Collection.

Why is it referenced as VBA?
Do we have to use VBA in order to do collections?



Wed, 13 Jul 2005 01:07:56 GMT  
 Why VBA.Collection and Not VB.Collection?


Quote:
> I noticed some code which was written as VBA.Collection to
> declare a New Collection.

> Why is it referenced as VBA?
> Do we have to use VBA in order to do collections?

Start VB and use View / Object Browser and change the selection from <all
libraries> to VBA and you will see what the VBA library in VB contains.  The
Collection object is just one part of it and many other things are in there.

You would only *need* to use 'VBA.Collection' if you are referencing another
object that also provides a 'Collection' property.  It doesn't hurt to do it
anyway but it's not common.  This is similar to having a project using both
DAO and ADO and having to use DAO.Recordset and ADO.Recordset instead of
just 'RecordSet' to be able to specify which one you want.



Wed, 13 Jul 2005 01:22:48 GMT  
 Why VBA.Collection and Not VB.Collection?

Quote:

> I noticed some code which was written as VBA.Collection to
> declare a New Collection.

> Why is it referenced as VBA?
> Do we have to use VBA in order to do collections?

Well, first there was VB3.  Then, they put VB into the office
applications, but at the same time, they started upgrading it,
producing VBA (which was actually better than VB, aside from being
confined to Excel etc.).  So when they did VB4, in the course of the
other updates, they also shared VBA with VB.  The "VB" portion of the
library consists of controls and system access stuff.  The "VBA"
portion of the library consists of all the "library" stuff like string
manipulation, containers, financial functions, etc.  The "VB" stuff
is all specific to VB, while the "VBA" stuff is shared with VBA, I
think.

I don't think (aside from the whole .Net thing) that there's any
meaningful distinction between VB and VBA, except for standalone (and
the toolkit that goes with it) vs. application-embedded.



Wed, 13 Jul 2005 03:06:49 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. VB Collections - Accessing the collection, not the item.

2. Collections, Collections and More Collections

3. Why can I not access my collection by key

4. using VB Printers object/collection in VBA

5. Problem with VB 6 OCX - VBA.Collections

6. Document collections and AllForms collections

7. Creating a CDO collection from an Outlook collection

8. using collection of collections

9. Storing a collection in a collection

10. collection in collection

11. Migrating to System.Collections.IEnumerator from VB6.Collection

12. Persisting a Collection of a Collection

 

 
Powered by phpBB® Forum Software