DavidMFairchild

Using IPIData2 interface with late binding

Discussion created by DavidMFairchild on Aug 16, 2011
Latest reply on Aug 23, 2011 by DavidMFairchild
I have an Excel VBA project that keeps dropping the references to the PISDK causing compile errors when the application opens.  To resolve this I am implementing late binding which shouldn't require the reference.  However I have a few functions that use the advanced IPI2 interface.  Typically I would implement this as ...
...
dim pipt as PIPoint
dim piDat as IPIData2
...
set piDat = pipt.Data
...
set nvVals = piDat.Summaries2(StartDate, EndDate, sInterval, asAverage, cbTimeWeighted)
...
Using this the PIPoint.Data object is automatically cast into an IPIData2 interface.  But I don't know how to cast it using VBA and late binding.  As in ...
...
dim pisdk as Object
dim srv as Object
dim pipt as Object
dim piDat as Object 'needs to be an IPIData2 interface object
...
set pisdk = CreateObject("PISDK.PISDK")
set srv = pisdk.Servers.DefaultServer
set pipt = srv.PIPoints("MyPoint")
set piDat = ????
...
Can anyone tell me how to do this? Thanks

Outcomes