This example uses the IsObject function to determine if an identifier represents an object variable. MyObject
and YourObject
are object variables of the same type. They are generic names used for illustration purposes only.
Dim MyInt As Integer, YourObject, MyCheck ' Declare variables.
Dim MyObject As Object
Set YourObject = MyObject ' Assign an object reference.
MyCheck = IsObject(YourObject) ' Returns True.
MyCheck = IsObject(MyInt) ' Returns False.