IsObject Function

Description

Returns a value indicating whether an expression references a valid OLE Automation object.

Syntax

IsObject(expression)

The expression named argument can be any expression.

Remarks

IsObject returns True if expression is a valid reference to an actual object; otherwise, it returns False.

See Also

IsArray Function, IsDate Function, IsEmpty Function, IsError Function, IsMissing Function, IsNull Function, IsNumeric Function, Object Data Type, Set Statement, TypeName Function, Variant Data Type, VarType Function.

Example

This example uses the IsObject function to determine if a variable references a valid object. MyObject and YourObject are object variables of the same type. They are generic names used here for illustration purposes only.


Dim MyInt As Integer    ' Declare variable.
Set YourObject = MyObject    ' Assign an object reference.
MyCheck = IsObject(YourObject)    ' Returns True.
MyCheck = IsObject(MyInt)    ' Returns False.