OLE_IsObjectValid() Function
- Last UpdatedFeb 20, 2017
- 1 minute read
In a script, you can verify that an OLE object is valid by using the OLE_IsObjectValid() function. This is not a required step for working with OLE objects, but it is recommended to make sure that you do not come across problems when working with OLE objects.
Syntax
result = OLE_IsObjectValid(%pointer)
Arguments
%pointer
The pointer referencing an OLE object that is to be tested.
result
A Boolean value indicating the following:
0 - The OLE object the pointer is referencing is invalid.
1 - The OLE object the pointer is referencing is valid.
Example(s)
This script creates an OLE object based on the Wscript.Shell class and creates a pointer %WS to reference it. isvalid is a discrete tag that is TRUE if the OLE object is created successfully. Otherwise it is FALSE.
OLE_CreateObject(%WS, "Wscript.Shell");
isvalid = OLE_IsObjectValid(%WS);