Lintz
09-06-2003, 08:23 PM
I'm using values in Excel to plot on a MSChart. My problem is the last row of the range will vary on a daily basis so I need the arrPortfolio array to reflect the new range. I find the last row (LastCompletedRow) but it won't except it when declaring arrPortfolio. How can I get around this so the arrPortfolio array will except the LastCompleteRow ?
Dim arrPortfolio(1 To LastCompletedRow)
Dim i As Integer
For i = 1 To LastCompletedRow
arrPortfolio(i) = objExcel.Worksheets(2)
.Range("AD" & i + 1).Value
Next i
MSChart1.ChartData = arrPortfolio
MSChart1.chartType = VtChChartType2dLine
Dim arrPortfolio(1 To LastCompletedRow)
Dim i As Integer
For i = 1 To LastCompletedRow
arrPortfolio(i) = objExcel.Worksheets(2)
.Range("AD" & i + 1).Value
Next i
MSChart1.ChartData = arrPortfolio
MSChart1.chartType = VtChChartType2dLine