CitectVBA supports the referencing and control of OLE Automation objects of external applications, permitting you to use the properties, methods and events of those objects from within CitectSCADA.
To access an OLE Automation object using CitectVBA, you must first declare an object variable in your CitectVBA code, then assign an OLE Automation reference to the variable. See Declaration of OLE Automation objects in CitectVBA, and Assigning references to OLE Automation objects in CitectVBA.
Objects declared in a CitectVBA Sub or Function procedure are local to that procedure, and their lifetime ends along with the end of the procedure. An object declared outside a procedure has modular scope to all procedures within the same CitectVBA file module and lasts for the lifetime of the variable that retains the reference to the object.
All object references must be deleted when they are no longer required, to release the memory they were using.
When considering the use of OLE Automation, you should be aware that there are different uses of OLE which have developed over the years and which may be confused with one another.
See Also