Nothing Variable

An object type constant that is initialized with no object value.

Value

0

Type

Object Public Const

Comments

Use this constant to test if an object variable is set. By default, all object variables are initialized to the Nothing variable.

Example

The following example creates an Excel spreadsheet object and use the Nothing constant to test if that failed:

! Create Excel app object

ob=CreateObject("Excel.Application")

if ob=Nothing

MsgBox("Unable to Create Excel.Application. Check if MS Excel is installed properly. Aborting...")

abort

endif

See Also

ActiveX Procedures, CreateObject, GetObject