'ListBox.List Could not get the list property
Not enough memory resources are available to complete this operation '-2147024882 (8007000e)'
I am receiving an error regarding List Property. Usually this occurrs when there is only one option in the table. Not sure what I am doing wrong :(. My code is below:
The Error happens at xV = xLstBox.List(I)
Sub Rectangle2_Click()
Dim xSelShp As Shape, xSelLst As Variant, I, J As Integer
Dim xV As String
Set xSelShp = ActiveSheet.Shapes(Application.Caller)
Set xLstBox = ActiveSheet.ListBox1
If xLstBox.Visible = False Then
xLstBox.Visible = True
xSelShp.TextFrame2.TextRange.Characters.Text = "Pick Measure Application Type"
xStr = ""
xStr = Range("MeasureAppBoxOutput").Value
If xStr <> "" Then
xArr = Split(xStr, ";")
For I = xLstBox.ListCount - 1 To 0 Step -1
xV = xLstBox.List(I)
xV = xLstBox.List(I)
For J = 0 To UBound(xArr)
If xArr(J) = xV Then
xLstBox.Selected(I) = True
Exit For
End If
Next
Next I
End If
Else
xLstBox.Visible = False
xSelShp.TextFrame2.TextRange.Characters.Text = "Pick Measure Application Type"
For I = xLstBox.ListCount - 1 To 0 Step -1
If xLstBox.Selected(I) = True Then
xSelLst = xLstBox.List(I) & ";" & xSelLst
End If
Next I
If xSelLst <> "" Then
Range("MeasureAppBoxOutput") = Mid(xSelLst, 1, Len(xSelLst) - 1)
Else
Range("MeasureAppBoxOutput") = ""
End If
End If
End Sub
Picture of an example of the table being referenced:
Picture of the error:
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|


