+ Reply to Thread
Results 1 to 2 of 2

Runtime Error 380 - Could not set the Property Value. Invalid Property Value

  1. #1
    Registered User
    Join Date
    03-29-2021
    Location
    Arima Trinidad
    MS-Off Ver
    MS 2013
    Posts
    1

    Runtime Error 380 - Could not set the Property Value. Invalid Property Value

    I am using a simple code to run a game for my students and I am getting an error. I'm not certain what the issue is as I have the same code on another slide and it works.

    Private Sub CommandButton21_()
    ComboBox21.Visible = False
    ComboBox22.Visible = False
    ComboBox23.Visible = False

    With ComboBox21
    .Clear
    .AddItem "What………you do everyday?", 1
    .AddItem "Where………she go yesterday?", 2
    .AddItem "Why…………she go in for the tennis this year?", 3
    .AddItem "Whom……you send the email to yesterday?", 4
    .AddItem "What day………….they go to the gym?", 5
    .AddItem "Whom…………you usually help?", 6
    .AddItem "Whose book……….you take yesterday?", 7
    .AddItem "What time…………….she usually come home?", 8
    .AddItem "How long………they train last year?", 9
    .AddItem "What book………he read everyday?", 10
    .AddItem "Where…….you often go in the evening?", 11
    .AddItem "Where………they come from 2 years ago?", 12
    .AddItem "What subjects……he excel at?", 13
    .AddItem "What subject……you like last year?", 14
    End With

    With ComboBox22
    .Clear
    .AddItem "do", 1
    .AddItem "did", 2
    .AddItem "did", 3
    .AddItem "did", 4
    .AddItem "do", 5
    .AddItem "do", 6
    .AddItem "did", 7
    .AddItem "does", 8
    .AddItem "did", 9
    .AddItem "does", 10
    .AddItem "do", 11
    .AddItem "did", 12
    .AddItem "does", 13
    .AddItem "did", 14
    End With

    End Sub

    Private Sub CommandButton22_Click()

    For k = 1 To 14
    ComboBox21.ListIndex = k .....(debug error shows up here)
    ComboBox22.ListIndex = k

    If yourresponse = ComboBox22 Then
    MsgBox "Awesome"

    Else
    MsgBox "Try again"
    End If


    Next k


    End Sub

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    19,828

    Re: Runtime Error 380 - Could not set the Property Value. Invalid Property Value

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)





    Listbox lists are zero based. Yours has 14 items so your loop should go 0 to 13.
    Cheers
    Andy
    www.andypope.info

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Error 381Could not set the List property. Invalid property array index
    By desonny in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-16-2020, 08:33 AM
  2. Runtime Error 380 - Could not set the Property Value. Invalid Property Value
    By natks78 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-02-2015, 10:51 PM
  3. Runtime error 381: Could not set the list property.Invalid property array index
    By rohith4prithvi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-23-2014, 10:24 PM
  4. Run-time Error '380': Could not set the RowSource property. Invalid property value
    By Rem0ram in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-26-2013, 03:57 PM
  5. [SOLVED] Excel run-time error '381': Could not set the List property. Invalid property array index
    By eemiller1997 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-20-2012, 12:48 PM
  6. Replies: 2
    Last Post: 06-24-2010, 01:57 AM
  7. Runtime Error 380 – Could not set the list property. Invalid property value
    By BernzG in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-21-2005, 05:10 PM

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