IsObject function

Category: Array / Information

Summary

True if expression is object.

Syntax

IsObject(identifier) The required identifier argument is a variable name.

Example

Example
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 ' Declare variables.
Dim YourObject, MyCheck ' Note: Default variable type is Variant.
Dim MyObject As Object
Set YourObject = MyObject ' Assign an object reference.
MyCheck = IsObject(YourObject) ' Returns True.
MyCheck = IsObject(MyInt) ' Returns False.
MyCheck = IsObject(Nothing) ' Returns True.
MyCheck = IsObject(Empty) ' Returns False.
MyCheck = IsObject(Null) ' Returns False.

Microsoft Support Page

https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/isobject-function

Back to Functions