Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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
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
Check for an item in a collection (without looping) Rob Excel Programming 2 February 10th 05 11:18 AM
Retrieving a Collection Item Todd Huttenstine Excel Programming 2 October 27th 04 07:15 PM
Characters Object limitation? nguy0531 Excel Programming 1 May 5th 04 11:52 AM
Add Unique item to Collection Dick Kusleika[_3_] Excel Programming 8 January 21st 04 08:59 PM
Removing an Item From a Collection Dan Gesshel Excel Programming 4 November 1st 03 01:12 PM


All times are GMT +1. The time now is 01:11 AM.

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"