PI ProcessBook extends every symbol with a number of properties. Among these properties is a "Selected" property. This is different then the Listbox's builtin Selected property. This extended property is what's being accessed when the listbox controls are accessed by name in PI ProcessBook (i.e. ListBox1.Selected is the PI-ProcessBook provided extended property).
In order to use the bultin Selected property of the Listbox control, we need to access the Listboxes as native MSForms.ListBox controls. Please try the sample code below:
Dim i As Long Dim myMessage As String Dim lst As MSForms.ListBox Set lst = ListBoxGC For i = 0 To lst.ListCount - 1 If lst.Selected(i) = True Then myMessage = myMessage & lst.List(i) & ";" & vbCrLf End If Next i MsgBox myMessage
I tried your code and it's working perfectly !