Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Declaring a collection as a particular type of object or a particular class
Is there a way to declare a collection object as a collection of a
particular type of object or as a collection of a particular class? Would like this for intellisense purposes. -- Sincerely, Ronald R. Dodge, Jr. Master MOUS 2000 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Declaring a collection as a particular type of object or a particular class
You can only declare a collection object '"As Collection" or "As Object.
Thereafter, if fully declared, you will get the intellisense as pertains to the collection object. Depending on what you are doing and your needs, maybe you could use an array of objects instead, eg Private arrCls() As myClass ReDim arrCls(1 to n) Set arrCls(1) = new myClass arrClss(1). after typing the dot you should get the intellisense To destroy all objects in the array Erase arrCls ' not necessary of arrCls is about to go out of scope FWIW, if you are only adding, not 'removing' objects, I prefer to use an array like this. Although string key is not available the 'index' of course is. Regards, Peter T "Ronald Dodge" wrote in message ... Is there a way to declare a collection object as a collection of a particular type of object or as a collection of a particular class? Would like this for intellisense purposes. -- Sincerely, Ronald R. Dodge, Jr. Master MOUS 2000 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Class modules: parametrize class object fields | Excel Programming | |||
User-defined type collection in class module | Excel Programming | |||
Declaring Data Type of Array | Excel Programming | |||
RaiseEvent from a class contained in a 2nd class collection? | Excel Programming |