I'm trying to determine if a variant has been set to Nothing or not and I'm not having any success finding examples for some reason. Here is one of my experiments that didn't work:
What is the proper way to check if a variant is an object or if it is unset? Sorry if this is a real newbie question..
Code:
Class someClass
Public z
End Class
Dim Fu
Set Fu = new someClass
Fu.z = "Test"
MsgBox(Fu.z)
Set Fu = Nothing
' ...
If Fu <> Nothing Then MsgBox("Fu is not nothing...")
'Comparing Fu to Nothing above throws the runtime error.
What is the proper way to check if a variant is an object or if it is unset? Sorry if this is a real newbie question..