Help!!!!
I'm putting together a dictionary of terms and keep getting a Compile error: User-defined type not defined for "itmX As ListItem". I have the microsoft scripting runtime library checked.
How do I get rid of this error?
My code is:
Private Sub Form_Load()
Dim dicX As Scripting.Dictionary
Dim varK As Variant
Dim varI As Variant
Dim lngX As Long
Dim itmX As ListItem
Set dicX = New Scripting.Dictionary
dicX.Add "A", "Athens"
dicX.Add "B", "Belgrade"
dicX.Add "C", "Cairo"
varK = dicX.Keys
varI = dicX.Items
For lngX = 0 To dicX.Count - 1
Set itmX = ListView1.ListItems.Add
With itmX
.Text = varI(lngX)
.SubItems(1) = varK(lngX)
End With
Next lngX
ListView1.AddItem.ListItem
End Sub
Owen
I'm putting together a dictionary of terms and keep getting a Compile error: User-defined type not defined for "itmX As ListItem". I have the microsoft scripting runtime library checked.
How do I get rid of this error?
My code is:
Private Sub Form_Load()
Dim dicX As Scripting.Dictionary
Dim varK As Variant
Dim varI As Variant
Dim lngX As Long
Dim itmX As ListItem
Set dicX = New Scripting.Dictionary
dicX.Add "A", "Athens"
dicX.Add "B", "Belgrade"
dicX.Add "C", "Cairo"
varK = dicX.Keys
varI = dicX.Items
For lngX = 0 To dicX.Count - 1
Set itmX = ListView1.ListItems.Add
With itmX
.Text = varI(lngX)
.SubItems(1) = varK(lngX)
End With
Next lngX
ListView1.AddItem.ListItem
End Sub
Owen