+ Reply to Thread
Results 1 to 9 of 9

Excel run-time error '381': Could not set the List property. Invalid property array index

  1. #1
    Forum Contributor
    Join Date
    10-25-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    292

    Excel run-time error '381': Could not set the List property. Invalid property array index

    I have a Multi-Page Userform and I've been able to test the userform many times, then suddently yesterday I get this "run-time error '381': Could not set the List property. Invalid property array index."

    I'm not sure why I am now getting this. I made changes to the form yesterday, but not changes to anything to warrent this problem. Now I can't even test this form, let alone use it.

    Please help.

    Here is the code that the debug takes me to.

    Please Login or Register  to view this content.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    Are there any candidates listed on CandidateData?

    If there are how many?
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    10-25-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    292

    Re: Excel run-time error '381': Could not set the List property. Invalid property array in

    one. I had tried to enter three, but I had done it wrong. I had entered a candidate's data and didn't press add/update because I wanted to see if it would work to enter a second and third and then finally press add/update. But that didn't work. It only added the one. I was just playing around to see how the form is working. So, just one candidate.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    Only one candidate is the problem, not the code.

    You need to adjust the code to check for the no of candidates.

    If there is only one candidate use AddItem, if there's more than one use List.

  5. #5
    Forum Contributor
    Join Date
    10-25-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    292

    Re: Excel run-time error '381': Could not set the List property. Invalid property array in

    How do I adjust the code to accomodate that? What do you mean by using List if there is more than one?

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    The code already uses List t populate the combobox.

    List won't work if there's only one candidate.

    Try this, but be warned this is roughly written code and is probably prone to errors - don't have IntelliSense on my phone.
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    10-25-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    292

    Re: Excel run-time error '381': Could not set the List property. Invalid property array in

    That seems to have worked. I tested it by entering one candidate name and information and clicking add/update. Then, I closed the box and reopened it using my macro box on the form to re-open the userform and it opened just fine. Thank you

  8. #8
    Forum Contributor
    Join Date
    10-25-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    292

    Re: Excel run-time error '381': Could not set the List property. Invalid property array in

    So, this error was showing elswhere, but now it's showing under the frmPrintCand.... what could be the problem.

    Please Login or Register  to view this content.
    Changing Attachment, please use this one.

    ComboBoxPrintBox_TroublesV10.xlsm
    Attached Files Attached Files
    Last edited by eemiller1997; 12-20-2012 at 11:46 AM.

  9. #9
    Forum Contributor
    Join Date
    10-25-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    292

    Re: Excel run-time error '381': Could not set the List property. Invalid property array in

    It's been figured out. Yay!

    The changes in red were necessary:
    Please Login or Register  to view this content.

+ 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