I need to create a Trend with VBA...
Some additional information about your requirement will be helpful here. For example are you trying to create the trend in ProcessBook? or you are simply thinking of doing this in other environments that supports VBA like Excel?
If you are willing to create a trend in a display of PI ProcessBook, please refer to the example below copied from PI ProcessBook Programmer Reference Guide.
Public Sub CreateTrend()
'PB Symbol object
Dim oTrend As Trend
Dim sServer As String
Dim sTagName As String
sServer = "\\servername\"
sTagName = "sinusoid"
'add a trend object to the Symbols collection
'the Add function will return a reference to the trend object
Set oTrend = ThisDisplay.Symbols.Add(pbSymbolTrend)
.Name = "TestTrend1"
'set the position and size of the trend
.Top = 14950
.Left = -14700
.Width = 1000
.Height = 750
'call the AddTrace function for every tag to be trended
.AddTrace sServer & sTagName
'this trend will display the previous 12 hours
.SetStartAndEndTime Format(DateAdd("h", -12, Now), "dd-mmm-yy hh:nn:ss"), Format(Now, "dd-mmm-yy hh:nn:ss")
'set the title text
.TrendTitle = "Trend Example"
Let us know if this example is helpful to you.
Exactly what i needed!!!
About ProcessBook Programmer Reference Guide where i can download
Just look at the help menu in ProcessBook, I think it's already included!
Retrieving data ...