Dim Test As TSTest Dim tsetList As List 'tsetList contains the list of tests under a particulat Testset For Each Test In tsetList If Test.HasAttachment = False Then ListBox2.AddItem Test.Name Set tsetList2 = Test 'Getting a type mismatch error End If Next
Where do you populate tsetList with tests? I see you have declared it in the Dim statement, but then you start using it in the For Each statement without populating it.
Where is your declaration for tsetList2? Is it supposed to be a list also? If so, you can't set a List to be equal to a non-list entity (Test). If you want to add something to a list then you need to use its Add method -
<ListObject>.Add(<ThingToAdd)