IsObject (function)

Syntax

IsObject(expression)

Description

Returns True if expression is a Variant variable containing an Object; returns False otherwise.

Example

This example will attempt to find a running copy of Excel and create 'a Excel object that can be referenced as any other object in the Basic Control Engine.

Sub Main()
  Dim v As Variant
  On Error Resume Next
  Set v = GetObject(,"Excel.Application")               

  If IsObject(v) Then
    MsgBox "The default object value is: " & v = v.Value  'Access value property of the object.
  Else
    MsgBox "Excel not loaded."
  End If
End Sub

See Also

Variant (data type); IsEmpty (function); IsDate (function); IsError (function); VarType (function); IsNull (function).

More information

I