How to use the VBA ISOBJECT Function (Syntax + Example)

HomeVBA Functions LIST (Category Wise)How to use the VBA ISOBJECT Function (Syntax + Example)

The VBA ISOBJECT function is listed under the information category of VBA functions. When you use it in a VBA code, it evaluates the supplied expression and returns TRUE if it is an object else FALSE. In simple words, it can check whether the value supplied is an object or not and returns TRUE or FALSE based on that.

Syntax

IsObject(Expression)

Arguments

  • Expression: An expression that you want to test if it’s an object or not.

Example

To practically understand how to use VBA ISOBJECT function, you need to go through the below example where we have written a vba code by using it:

Sub example_ISOBJECT()
Dim myOB As Object
Range("A1").Value = IsObject(myOB)
End Sub

In the above code, we have used ISOBJECT to check if the myOB is an object or not. As we have already declared myOB as an object the code has returned TRUE in the result.

Related Functions

ISARRAY | ISDATE | ISEMPTY | ISERROR | ISMISSING | ISNULL | ISNUMERIC