Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

Using OLE Automation Objects

  • Last UpdatedJul 18, 2023
  • 2 minute read

The trick with successfully using OLE Automation is determining what you can and can't do with it. In theory, you can do anything the OLE Automation server application can do. However, in practice, not every OLE Automation server application exposes all of its functionality through its OLE Automation interface.

You have to be able to use the native programming language of the OLE Automation server application in your code. You also need to know about the limitations imposed by the Plant SCADA operating environment, and its implementation of the VBA programming language.

VBA does not support early binding of OLE Automation objects, as there is no mechanism for providing a reference to the object type library (like you can do in Microsoft Visual Studio) until runtime. So, VBA compile errors can occur with valid VBA code which may work well in other VBA supporting applications. Most ported VBA code will require some modification to compile and perform as expected in VBA. For example, VBA does not support the use of "With" statements concerning properties or methods of an object, yet does support the use of "For Each" statements with objects in a collection.

VBA does not support the use of named arguments using the ":=" named argument operator (colon followed by an equal sign). Nor does it support the use of missing arguments using placeholder commas, however, VBA does support the use of the "empty" keyword in place of missing arguments.

VBA does not support the passing of SCADA variable tags by reference, however, the tag value can be copied to a VBA variable, and it can be passed by value. See Passing Variables Byref and Byval with VBA.

To help manage these considerations, you should know how to access the object model of the OLE Automation server applications. VBA does not support the use of application-defined object types nor intrinsic constants due to late-binding of the object model. VBA supports only 10 data-types, so be aware of the possibility of data being lost due to rounding when converting between different data types. See Rounding Numbers in VBA.

To make full use of the OLE Automation object models, you should make yourself familiar with Object related terms. See Understanding object models in OLE Automation.

See Also

OLE Automation Objects

Related Links
TitleResults for “How to create a CRG?”Also Available in