Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Class modules: parametrize class object fields Jean-Pierre Bidon Excel Programming 11 August 31st 06 02:49 PM
User-defined type collection in class module Rob[_29_] Excel Programming 2 May 31st 06 06:02 PM
Declaring Data Type of Array [email protected] Excel Programming 8 February 7th 06 05:53 AM
RaiseEvent from a class contained in a 2nd class collection? Andrew[_16_] Excel Programming 2 January 6th 04 04:22 PM


All times are GMT +1. The time now is 09:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"