A List of Collections and Custom Collections

E

ExcelMonkey

1) Where can I find a list of all the object collections in VBA?
2) What function/property returns an objects Collection (i.e. fnc(worksheet)
= Worksheets
3) Is it possible to create custom collections? How do you do this?

Thanks

EM
 
S

sebastienm

Hi,

1)Since each library has its own set of objects, properties, ...
collections, it depends on libraries your are using in each project.
Now, you can search the online help for 'Excel Object Model' and you'll
find an interesting map of all objects and collections (based on coloring) in
Excel, as well as some 'hierarchy/dependency' between them.
2) ... too extensive but the Object Browser is a place to start. (key F2 or
menu View > Object Browser.
3) DIm MyCol as Collection
Set MyCol = New Collection
''' Collections have 4 sub/functions: Add, COunt, Item , Remove
and look in the online help for examples

On top of that, you can wrap a Collection in a class to make it strongly
types and better control it, like Worksheets which has an Add and COunt like
in COllection, but implements many more subs/functions.
Search the web for 'vba "Collection Class" ' or ' vb6 "Collection Class" '
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top