General VB, i have a single column, multi-select listbox i am populating with file paths from components in an assembly. I need to add the path ONLY if it doesn't already exist.
i can either do it as i process the components of the assembly, or after the fact. I would prefer while. that being said the function below is giving me an error. of: "vba could not get the list property. invalid property array index"
Private Function AddListBoxItem(pathName As String) As Boolean
Dim x As Integer
For x = 0 To F1.Lb.ListCount
If LCase(pathName) = LCase(F1.Lb.List(x)) Then
F1.Lb.List(x) = pathName
AddListBoxItem = False
AddListBoxItem = True
If AddListBoxItem = True Then
MsgBox "Item already exists"
i thought (via a google searches) that using "contains" as below was supposed to compare, but contains was not avail.