I'm having trouble representing my data with a line graph. Eventually I would like to export my data and graph into an HTML format, but I'm not there, yet! I'm using the MSChart to represent the data. I need to redim my array because the datafile size will vary. It could have 2 or 3 results, 500, or higher in the data file. If I do not redim my array (and statically assign it), it works, but since I need to redim the array, it doesn't and I get the following error: "Run-time error '1101': Bad Function argument". Is there a way around this or do I need to use something else or try another method?
Private Sub RunStats()
Dim i As Integer
Dim NextRecord As Integer
Dim HostAddress As String
FileNo = FreeFile
RecLength = Len(MyData(1))
FileName = App.Path & "\data.dat"
Open FileName For Random As FileNo Len = RecLength
NextRecord = (LOF(FileNo) / Len(MyData(1)))
ReDim arrRTT(1 To NextRecord)
For i = 1 To NextRecord
Get FileNo, i, MyData(1)
arrRTT(i) = LTrim(MyData(1).RTT)
List1.AddItem (arrRTT(i)) 'DATA CHEcK ONLY
MSChart1.ChartData = arrRTT