I don't think this is better than the Vityata function, but as an alternative:
Function isIterable(obj As Object) As Boolean
On Error Resume Next
isIterable = TypeName(CallByName(obj, "_NewEnum", VbGet)) = "Unknown"
If Not isIterable Then isIterable = TypeName(CallByName(obj, "_NewEnum", VbMethod)) = "Unknown"
End Function
source
share