Results 1 to 5 of 5
  1. #1
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Reporting of Colections in Locals WIndow (Excel VBA (all?))

    You can run code like this:
    <pre>Sub Test()
    Dim Coll As New Collection
    Dim lArray(1 To 500) As Long
    Dim x As Long
    For x = 1 To 500
    lArray(x) = x
    Coll.Add x
    Next
    End Sub</pre>


    o create an array of 500 values and a collection of 500 values. If you put a break on the "end sub" you can stop the code and look at the variables in the locals window. The Array shows all 500 items, but the items in the collection only show 256. Further investigation (dumping it to an array, a range, or checking the items, etc) demonstrates that the collection contains all 500 items, it just does not seem to show them all in the locals window.

    Is this a known bug in XL97? Does it still exist in other versions? Is it really an issue that needs to be worried about?

    Steve

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Reporting of Colections in Locals WIndow (Excel VBA (all?))

    I can verify that it behaves the same way in 2K.
    Legare Coleman

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Reporting of Colections in Locals WIndow (Excel VBA (all?))

    And the same in Office XP (2002) VBA too - this is not surprising, because Office XP and Office 2000 both use Visual Basic 6.3.

  4. #4
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Reporting of Colections in Locals WIndow (Excel VBA (all?))

    Same in '03, Steve.

    Some time back <!profile=Charlotte>Charlotte<!/profile> pointed out to me in the VBA Forum that she has had occasional problems with:

    For Each Object in Collection

    and she avoids those problems (and following her advice, so do I) by using

    For lCounter = 1 to Collection.Count
    Collection(lCounter).whatever

    Wonder if the issues are related.
    -John ... I float in liquid gardens
    UTC -7ąDS

  5. #5
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Reporting of Colections in Locals WIndow (Excel VBA (all?))

    Don't know if it is related, but I could use for each to put all 500 items into the spreadsheet without issue, so in this example it did not stop at 256.

    Steve

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •