Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Defining a Property
How would I define a collection as a property of a class?
|
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Defining a Property
I just posted and I think the post is lost so here goes again:
I am trying to create an polygon area as a class. As part of the definition of each instance of the area is the collection of points defining corners around its perimeter. The number of sides is equal to the number of corners. I also created a class called PolyPoint with the properties of the coordinates of a point. I am trying to add a collection of PolyPoints to each instance of the area class. "Jim Thomlinson" wrote: You have me a little lost here. A collection is not really a property but more of a container for objects. So what do you mean by a perperty. Do you mean the prperties of the objects within the collection? You can make the collection accessible as a part fo teh class by just declaring it public kind of like this CLASS Option Explicit Public col As Collection Private Sub Class_Initialize() Set col = New Collection End Sub MODULE Sub test() Dim var As Class1 Set var = New Class1 var.col.Add Sheet1, Sheet1.Name End Sub -- HTH... Jim Thomlinson "Cody" wrote: How would I define a collection as a property of a class? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Defining a Property
You have me a little lost here. A collection is not really a property but
more of a container for objects. So what do you mean by a perperty. Do you mean the prperties of the objects within the collection? You can make the collection accessible as a part fo teh class by just declaring it public kind of like this CLASS Option Explicit Public col As Collection Private Sub Class_Initialize() Set col = New Collection End Sub MODULE Sub test() Dim var As Class1 Set var = New Class1 var.col.Add Sheet1, Sheet1.Name End Sub -- HTH... Jim Thomlinson "Cody" wrote: How would I define a collection as a property of a class? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Runtime Error 380 – Could not set the list property. Invalid property value | Excel Programming | |||
Defining | Excel Discussion (Misc queries) | |||
Value Property vs Text property | Excel Programming | |||
Runtime error 380: Could not set the List property. invalid property value of listbox | Excel Programming | |||
Is there a Filename property in PrintOut property | Excel Programming |