I have the Graybox OPC Automation Wrapper (gbda_aut.dll) which I am using to connect Excel 2013 (via VBA) to an OPC server (Rockwell FactoryTalk Gateway).
All is good until I try and add and item to the group I have created.
When I run the VBA code Excel crashes with a just-in-time error.
Here is my code:
Dim OPCItemID1 As String
Dim ClientHandle1 As Long
OPCItemID1 = "[OPCLabel]BarcodeScanned" 'Scanned Barcode Value
ClientHandle1 = 1975
myOPCGroup.IsSubscribed = False 'Unsubscribe group before adding items
Set myOPCItem = myOPCGroup.OPCItems
myOPCItem.AddItem OPCItemID1, ClientHandle1
Does anyone have any ideas of what is wrong or know of a OPC DA automation wrapper that will work with Excel 2013?
I investigated this problem deeply and even though the sample OPC Foundation DA code wrapper provided in the examples can be compiled to 64 bit, there are many modifications that needed to made (I.e. 64 pointers are casted into 32bit variables - and this is why crash occurs). I assume that Graybox DLL was compiled without those modifications also (I experienced the same crash in my own DLL and in theirs).