Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default maximum number of members in a collection

Hi

I tried to create an Excell2003 VB collection with say 1500-2000 members.
But after 256 members are added, the loop continues WITHOUT ANY ERROR MESSAGE
but no more members are added to the collection

Is it possible that 256 is the limit?

I couldn't find it written down anywhere, but that limit is just too low.

I was just wondering if any of you knows more about this?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default maximum number of members in a collection

Didn't you have a Byte variable anywhere causing the trouble?
Post the code.

RBS

"excel_ez" wrote in message
...
Hi

I tried to create an Excell2003 VB collection with say 1500-2000 members.
But after 256 members are added, the loop continues WITHOUT ANY ERROR
MESSAGE
but no more members are added to the collection

Is it possible that 256 is the limit?

I couldn't find it written down anywhere, but that limit is just too low.

I was just wondering if any of you knows more about this?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default maximum number of members in a collection

This is just a part of my original code:

Dim myCollection As New Collection
Dim member As clsMembers

Public i As Long


For i = 1 To 3000
Set member = Range(Cells(i, 1), Cells(i, 14))
myCollections.Add member
next

I am trying to create a collection of row within a range. I tried the same
mechanism with simple elements like numbers etc. but I never got past 256

"RB Smissaert" wrote:

Didn't you have a Byte variable anywhere causing the trouble?
Post the code.

RBS

"excel_ez" wrote in message
...
Hi

I tried to create an Excell2003 VB collection with say 1500-2000 members.
But after 256 members are added, the loop continues WITHOUT ANY ERROR
MESSAGE
but no more members are added to the collection

Is it possible that 256 is the limit?

I couldn't find it written down anywhere, but that limit is just too low.

I was just wondering if any of you knows more about this?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default maximum number of members in a collection

Sub abc()
Dim myCollection As Collection
Dim member As Range

Dim i As Long

Set myCollection = New Collection

For i = 1 To 3000
Set member = Range(Cells(i, 1), Cells(i, 14))
myCollection.Add member
Next
Debug.Print myCollection.Count
Debug.Print myCollection.Item(myCollection.Count).Address
End Sub


Returned:

3000
$A$3000:$N$3000

for me.

--
Regards,
Tom Ogilvy

"excel_ez" wrote in message
...
This is just a part of my original code:

Dim myCollection As New Collection
Dim member As clsMembers

Public i As Long


For i = 1 To 3000
Set member = Range(Cells(i, 1), Cells(i, 14))
myCollections.Add member
next

I am trying to create a collection of row within a range. I tried the same
mechanism with simple elements like numbers etc. but I never got past 256

"RB Smissaert" wrote:

Didn't you have a Byte variable anywhere causing the trouble?
Post the code.

RBS

"excel_ez" wrote in message
...
Hi

I tried to create an Excell2003 VB collection with say 1500-2000
members.
But after 256 members are added, the loop continues WITHOUT ANY ERROR
MESSAGE
but no more members are added to the collection

Is it possible that 256 is the limit?

I couldn't find it written down anywhere, but that limit is just too
low.

I was just wondering if any of you knows more about this?





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 747
Default maximum number of members in a collection

Your problem appears to originate from clsMembers. This worked for me:

Public i As Long
Sub x()
Dim myCollection As Collection
Dim member As Range 'clsMembers
Set myCollection = New Collection
For i = 1 To 3000
Set member = Range(Cells(i, 1), Cells(i, 14))
myCollection.Add member
Next
'Now test collection
For i = 500 To 3000 Step 500
MsgBox myCollection(i).Address
Next
End Sub

Regards,
Greg

"excel_ez" wrote:

This is just a part of my original code:

Dim myCollection As New Collection
Dim member As clsMembers

Public i As Long


For i = 1 To 3000
Set member = Range(Cells(i, 1), Cells(i, 14))
myCollections.Add member
next

I am trying to create a collection of row within a range. I tried the same
mechanism with simple elements like numbers etc. but I never got past 256

"RB Smissaert" wrote:

Didn't you have a Byte variable anywhere causing the trouble?
Post the code.

RBS

"excel_ez" wrote in message
...
Hi

I tried to create an Excell2003 VB collection with say 1500-2000 members.
But after 256 members are added, the loop continues WITHOUT ANY ERROR
MESSAGE
but no more members are added to the collection

Is it possible that 256 is the limit?

I couldn't find it written down anywhere, but that limit is just too low.

I was just wondering if any of you knows more about this?





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default maximum number of members in a collection

What is the code of clsMembers?

RBS

"excel_ez" wrote in message
...
This is just a part of my original code:

Dim myCollection As New Collection
Dim member As clsMembers

Public i As Long


For i = 1 To 3000
Set member = Range(Cells(i, 1), Cells(i, 14))
myCollections.Add member
next

I am trying to create a collection of row within a range. I tried the same
mechanism with simple elements like numbers etc. but I never got past 256

"RB Smissaert" wrote:

Didn't you have a Byte variable anywhere causing the trouble?
Post the code.

RBS

"excel_ez" wrote in message
...
Hi

I tried to create an Excell2003 VB collection with say 1500-2000
members.
But after 256 members are added, the loop continues WITHOUT ANY ERROR
MESSAGE
but no more members are added to the collection

Is it possible that 256 is the limit?

I couldn't find it written down anywhere, but that limit is just too
low.

I was just wondering if any of you knows more about this?




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default maximum number of members in a collection

the clsMembers looks like this:

Option Explicit

Public Artist As String
Public Album As String
Public Name As String
Public PlayCount As Integer
Public Genre As String
Public Size As Long
Public Time As Long
Public Year As Integer
Public TrackNumber As Integer
Public BitRate As Integer
Public LastPlayed As String
Public DateAdded As String
Public Rating As Integer
Public CheckSum As Single

Thanks a lot

"RB Smissaert" wrote:

What is the code of clsMembers?

RBS

"excel_ez" wrote in message
...
This is just a part of my original code:

Dim myCollection As New Collection
Dim member As clsMembers

Public i As Long


For i = 1 To 3000
Set member = Range(Cells(i, 1), Cells(i, 14))
myCollections.Add member
next

I am trying to create a collection of row within a range. I tried the same
mechanism with simple elements like numbers etc. but I never got past 256

"RB Smissaert" wrote:

Didn't you have a Byte variable anywhere causing the trouble?
Post the code.

RBS

"excel_ez" wrote in message
...
Hi

I tried to create an Excell2003 VB collection with say 1500-2000
members.
But after 256 members are added, the loop continues WITHOUT ANY ERROR
MESSAGE
but no more members are added to the collection

Is it possible that 256 is the limit?

I couldn't find it written down anywhere, but that limit is just too
low.

I was just wondering if any of you knows more about this?




  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default maximum number of members in a collection

Well

It works.

The thing is that I was looking at the collection in watch window and there
it lists only 256 members. However the whole collection is there and the
members can be accessed.

My mistake, I shouldn't have trusted the Watches :-|

Thanks to all of you


"excel_ez" wrote:

Hi

I tried to create an Excell2003 VB collection with say 1500-2000 members.
But after 256 members are added, the loop continues WITHOUT ANY ERROR MESSAGE
but no more members are added to the collection

Is it possible that 256 is the limit?

I couldn't find it written down anywhere, but that limit is just too low.

I was just wondering if any of you knows more about this?

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default maximum number of members in a collection

Just curiosity, why do you need a collection vs simply

Dim rng As Range
Set rng = Range(Cells(1, 1), Cells(3000, 14))
Debug.Print rng.Rows(rng.Rows.Count).Address

Regards,
Peter T


"excel_ez" wrote in message
...
This is just a part of my original code:

Dim myCollection As New Collection
Dim member As clsMembers

Public i As Long


For i = 1 To 3000
Set member = Range(Cells(i, 1), Cells(i, 14))
myCollections.Add member
next

I am trying to create a collection of row within a range. I tried the same
mechanism with simple elements like numbers etc. but I never got past 256

"RB Smissaert" wrote:

Didn't you have a Byte variable anywhere causing the trouble?
Post the code.

RBS

"excel_ez" wrote in message
...
Hi

I tried to create an Excell2003 VB collection with say 1500-2000

members.
But after 256 members are added, the loop continues WITHOUT ANY ERROR
MESSAGE
but no more members are added to the collection

Is it possible that 256 is the limit?

I couldn't find it written down anywhere, but that limit is just too

low.

I was just wondering if any of you knows more about this?





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
Maximum negative number Tigerxxx Excel Discussion (Misc queries) 2 June 15th 09 06:35 PM
Excel maximum Row number xiaoniao Excel Worksheet Functions 2 April 29th 08 02:44 PM
Team Role Rotation (number of team members is variable) Scott Wagner Excel Worksheet Functions 3 November 17th 06 11:25 PM
getting the number of the row with the maximum value hilbert Excel Discussion (Misc queries) 3 April 5th 05 01:06 PM
cell number in collection Chris Gorham[_3_] Excel Programming 1 December 26th 03 10:47 PM


All times are GMT +1. The time now is 01:23 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"