#  Other Applications & Softwares  > PowerPoint Formatting & General >  >  Runtime Error 380 - Could not set the Property Value. Invalid Property Value

## knec

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

----------


## Andy Pope

*Administrative Note:*

Welcome to the forum.  :Smilie: 

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.

----------


## Kennethwak

Thanks for your help, Dan and Ste

I ended up using the text rule it works beautifully. It never crossed my mind to handle it that way. Thanks again

----------

