GetPenDataArray Method Example
The following example generate a report containing all data contained inside a standard chart, Chart1, into a file.
Dim lNumPts As Long
Dim vVal As Variant
Dim vPsa As Variant
Dim vQual As Variant
Dim vMill As Variant
Dim toto As Object
Dim Mypath As String
Dim myfile As String
Dim RTN As String
RTN = ""
If Chart1.Pens.Count <> 0 Then
Mypath = System.BasePath
myfile = Mypath & "\app\ChartReport.txt"
RTN = Dir(myfile)
If RTN <> "" Then
'File do exist
'Delete Output file
Kill myfile
End If
Open myfile For Output As #1
For i = 1 To Chart1.Pens.Count
Chart1.Pens.Item(i).GetPenDataArrayEx lNumPts, vVal, vPsa, vQual, vMill
For j = 0 To (lNumPts - 1)
Value = vVal(j)
Time = vPsa(j)
Quality = vQual(j)
Mill = vMill(j)
Write #1, Chart1.Pens.Item(i).Source; " "; Time; " "; Value; ""
Next j
Next i
Close #1
End If