Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Collection Object, 255 item limitation
Hi
It appears I have run into a 255 item limitiation in VBA with the "Collection" object. Anyone have any ideas? This is what I have defined as <Code: < Public gcolE_Defs() As New Collection then when I execute the following code < gcolE_Defs(i).ADD Item:=oED, key:=CStr(iCount) and the iCount is beyond 255 or 256 it stops adding items to the collection. Anyone have any ideas????? Timothy Marks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Collection Object, 255 item limitation
Timothy,
It appears the syntax for the collection is incorrect. Try... gcolE_Defs.Add Item:=oED, Key:=CStr(iCount) Regards, Jim Cone San Francisco, USA "timothy" wrote in message ups.com Hi It appears I have run into a 255 item limitiation in VBA with the "Collection" object. Anyone have any ideas? This is what I have defined as <Code: < Public gcolE_Defs() As New Collection then when I execute the following code < gcolE_Defs(i).ADD Item:=oED, key:=CStr(iCount) and the iCount is beyond 255 or 256 it stops adding items to the collection. Anyone have any ideas????? Timothy Marks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Collection Object, 255 item limitation
Hi Jim
I purposely dimensioned the collection as a multi-dimensional collection object in my public statement by using (). So gcolE_Defs(i) is a proper reference to gcolE_Defs. At some point in my code I define a variable amount of dimensions so I can loop through ambiguous sets of data determined at runtime. Timothy. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Collection Object, 255 item limitation
Public gcolE_Defs() As New Collection
Sub ABC() ReDim gcolE_Defs(1 To 3) For i = 1 To 3 For icount = 1 To Int(Rnd() * 1000 + 4500) oED = Int(Rnd() * 10000 + 1) gcolE_Defs(i).Add Item:=oED, key:=CStr(icount) Next Next For i = 1 To 3 Debug.Print "gcolE_Defs(" & i & ") count is " & _ gcolE_Defs(i).Count & " last value is: " & _ gcolE_Defs(i).Item(gcolE_Defs(i).Count) Next End Sub produced: gcolE_Defs(1) count is 5205 last value is: 4011 gcolE_Defs(2) count is 5155 last value is: 3229 gcolE_Defs(3) count is 4804 last value is: 1691 So 255 doesn't appear to be a limit. -- Regards, Tom Ogilvy "timothy" wrote in message oups.com... Hi Jim I purposely dimensioned the collection as a multi-dimensional collection object in my public statement by using (). So gcolE_Defs(i) is a proper reference to gcolE_Defs. At some point in my code I define a variable amount of dimensions so I can loop through ambiguous sets of data determined at runtime. Timothy. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Collection Object, 255 item limitation
Hi Tom
You may be right. It appears the Watch editor in VBA is limited to 255 item limit. This is what I was going by. I figured what I couldn't see didn't exist. Timothy. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Check for an item in a collection (without looping) | Excel Programming | |||
Retrieving a Collection Item | Excel Programming | |||
Characters Object limitation? | Excel Programming | |||
Add Unique item to Collection | Excel Programming | |||
Removing an Item From a Collection | Excel Programming |