Hi gnrteixeira,
Do you have PI-DataLink? If so, this is simple to do using the "Current Value" menu option (PI -> Current Value) and enter a PI Tag from your PI Server.
If you purely want to do this from VBA then you can do this with PI-SDK.
To do so, have a quick look at this post showing how to connect to a PI server:
http://www.rjksolutionsl...t.aspx?g=posts&t=18
Then to use this you could do:
Code:If ConnectToPI() Then
'Get your PI Point object
Dim MyTag as PISDK.PIPoint
Set MyTag = PIServer.PIPoints("TAGNAME")
' Assign the current value to a Cell in MS Excel
Worksheets("WorksheetName").Range("A1").Value = MyTag.Data.Snapshot.Value
Set MyTag = Nothing
Else
End If
Hope this helps..?
Post some specifics of what you need to do if you want a more comprehensive example.
OSIsoft PI System SpecialistsPI consultancy on PI Systems, PISDK, AFSDK, OLEDB etc and PI custom developments. Well pretty much anything to do with PI!