ISOBJECT

ISOBJECT(identifier)

Returns the value True or False depending if the identifier represents an object (Boolean).


identifierThe variable name.

REMARKS
* If the variable has been set to Nothing, then True is returned.
* You should always use error handling to be sure that an object reference is valid.
* This function can be useful to determine if a variant is of the vbObject vartype.
* You can use the ISARRAY function to return True or False depending if the value is an array.
* You can use the ISDATE function to return True or False depending if the value is a date.
* You can use the ISEMPTY function to return True or False depending if the variable has been initialised.
* You can use the ISERROR function to return True or False depending if the value is an error.
* You can use the ISMISSING function to return True or False depending if an optional argument has been passed in.
* You can use the ISNULL function to return True or False depending if the value contains no data.
* For the Microsoft documentation refer to learn.microsoft.com

Dim MyInt As Integer 
Debug.Print IsObject(MyInt) ' False

Dim MyObject As Object ' Declare an object

Dim MyVariant As Variant
Debug.Print IsObject(MyVariant) ' False for Variants that are not initialised

Set MyVariant = MyObject ' Assign to an object reference.
Debug.Print IsObject(MyVariant) ' True

Debug.Print IsObject(Nothing) ' True
Debug.Print IsObject(Empty) ' False
Debug.Print IsObject(Null) ' False

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited Top