+ Reply to Thread
Results 1 to 4 of 4

excel validation lists

  1. #1
    Registered User
    Join Date
    09-29-2006
    Posts
    3

    excel validation lists

    When I select an item in say cell A:1, based on my selection a list is presented in cell B:1 in the form of a validation list where the list values are dynamically retieved from a database. This code has worked for ages, however some of the lists are now fairly large.
    I now receive the error,
    ---------------------------------------------------
    Run-time error '-2147417848(80010108)':

    Automation error
    The object invoked has disconnected from its clients

    ---------------------------------------------------

    If I reduce the number of items in the list then it works. So the question is is there a limit on the number of items I can have in a validation list. I don't want to use combo box objects so if there is a limit then suggestions for a better way of doing this would be appreciated. Code snippet below. red where debugger gets to.

    '//strList is a comma-delimitted list of values retrieved from a db. May have up to 200 values.
    strList = "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15"
    'Populate list with list items from db
    With curValueCell.Validation
    .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, _
    Operator:=xlBetween, Formula1:=strList

    .IgnoreBlank = True
    .InCellDropdown = True
    .ShowInput = False
    .ShowError = False

    End With

  2. #2
    Registered User
    Join Date
    09-29-2006
    Posts
    3

    Question

    No excel gurus out there?

  3. #3
    Registered User
    Join Date
    09-23-2006
    Posts
    9

    dimming

    I am not sure this will help but have you tried dimming the list with a larger value, I am assuming this is a vba code? in a sub routine. I am not sure what the default dimension is but it sounds like your over running it. if I understand your problem. and I am certainly no guru .. :D

  4. #4
    Registered User
    Join Date
    09-29-2006
    Posts
    3
    Thanks for you reply,
    strList is just a string that holds values retrieved from a table in a database. So I loop through the db and rather than redimming an array to store the retreived values before joining them into the string I concatenate the values directly into the string. So variable sizes should not be a problem. I have since found out that validation lists can store no more than 255 characters including the commas and cannot be increased. Why I don't know.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1