Citect GraphicsBuilder Automation VBA Reference Late Binding

Regarding CitectSCADA 2018 R2.

I prefer to use late binding for my VBA code for Citect GraphicsBuilder automation so other users won't have to manually select the GraphicsBuilder library reference via the VBA editor.

The VBA code works fine with early binding as follows:

Dim GraphicsBuilder As IGraphicsBuilder2
Set GraphicsBuilder = New GraphicsBuilder.GraphicsBuilder

However I can't get it to work using late binding as follows:

Dim GraphicsBuilder As Object
Set GraphicsBuilder = CreateObject("IGraphicsBuilder2.GraphicsBuilder")

Also I have unsuccessfully tried:

Set GraphicsBuilder = CreateObject("GraphicsBuilder.GraphicsBuilder")

Syntax for CreateObject method is CreateObject(class) where class is appname.objecttype. Can anyone help? 



 


  • Hi Dave,

    Using:
    Set GraphicsBuilder = CreateObject("GraphicsBuilder.Application.6.2") (or 6.1 depending on the Citect version, check in the library reference)
    should work.

    See https://softwaresupportsp.aveva.com/#/okmimarticle/docid/tn7161 as well.
  • Thank you Erik for your prompt reply, this has solved my problem.

    In my case the library version needs to be 6.1 however when viewing the GraphicsBuilder library from Microsoft Visual Basic Editor object browser the version is listed as 6.2. But if I use 6.2 the VBA code does not work.

    I am using CitectSCADA 2018 R2 version 8.20[1]. GraphicsBuilder ctDraw32.exe version is 8.20.0.1111.