@Björn Eiacute;ksson This gets worse..... there are more cases of this:
Dim v as Variant = 23
Dim a as Object = v
Just this simple example then as far as I know there is no way to Tell if a contains Variant there or some other object.
Since technically Variant is a object but you cannot do Isa on Variant. And Variant.Type will tell you its object since Variant is a object. And if you do Isa Object then you get True always since both Object and Variant are objects after all.
I did some more experiments on the missing
IsA possibilities. It turns out,
VarType() on the object can play that role here!
Dim v As Variant = 23
If v IsA Object Then Break //yes, Variant is a Object subclass
Dim o As Object = v //pass it along as such
' If o IsA Variant Then Break // does not compile: "There Is no Class With this name"
Dim ti As Introspection.TypeInfo = Introspection.GetType( o )
If ti = Nil Then Break // returns nil?!
MsgBox Str(VarType(o)) //shows 3 = Variant.TypeInt64 - not the expected 9 = Variant.TypeObject!
Dim v2 As Variant = o //works w/o a cast
MsgBox v2 //there it is again!
In the result you can store an array of Variant in a Variant but not a Variant in a Variant. Still if stored in a Variant, you cannot distinguish an array of Variant from an array of Object w/o guessing and exceptions.