Private Sub MyOPCGroup_DataChange(ByVal TransactionID As Long, _
ByVal NumItems As Long, _
ClientHandles() As Long, _
ItemValues() As Variant, _
Qualities() As Long, _
TimeStamps() As Date)
Dim SHandles(2) As Long 'parameter value
Dim Values() As Variant 'return value
Dim Errors() As Long 'return value
Dim Qual As Variant 'return value
Dim TS As Variant 'return value
SHandles(1) = MyOPCItems4.ServerHandle
SHandles(2) = MyOPCItems4.ServerHandle
Call MyOPCgroup.SyncRead(OPCCache, 2, SHandles, Values, Errors, Qual, TS)
Cells(MyOPCItems4, 1).Activate
Cells(MyOPCItems4, 1) = Values(1)
Cells(MyOPCItems4, 1) = Values(2)
Cells(MyOPCItems4, 2) = TS(1)
Cells(MyOPCItems4, 2) = TS(2)
End Sub
Hi, njimack. thankyou very much.
That's exactly what I needed, but do you also know how to make something where the cursor moves out of the cell which it is in at the moment your code is executed. Because right now it doesn't work when I'm writing in a different random cell at the moment your code is executed.
thanks.
Cells(MyOPCItems4, 1).Select