I am using a For Each loop to go through a Variant array in VB6. At one point, I want to convert the element of the loop (elem), which is a Variant, to a Node.

Code:
Dim elem as Variant

For Each elem In ndArray
    Dim nodle As Node
    nodle = CType(elem, Node)
Next
That's not the whole loop, but it gives you an idea of what I'm trying to do. When I run this code, I get an error saying "Variable not defined", which points to the 'Node' in the CType method. This is not a variable, it is a type and the method should know that since it is expecting a type.

Anyone know what's going on here? Is this conversion even possible?

Any suggestions would be greatly appreciated.