Try something like this:
If TypeOf YourObjectVariable Is Dictionary Then ' ... ElseIf TypeOf YourObjectVariable Is Collection Then ' ... Else ' Handle empty/other types here. End If
You can use something like this to control the flow of execution in your code or to create your own IsCollection () and IsDictionary () functions.
source share