I am getting this error when I try to create MSChart from the flexgrid data. The flexgrid has the years as a first column and months across the top. The flexgrid is fed by a textfile
  Dim iRowCount As Integer, iColumnCount As Integer ' chart's rows and columns   
  Dim dCurrData As Double ' I'll assign a chart cells data with this variable   
   Dim iYears As Integer
   MSChart1.ChartType = VtChChartType2dBar
   MSChart1.ShowLegend = True
   MSChart1.Repaint = False
   MSChart1.RowCount = iYears
   For iColumnCount = 1 To 1
        ' You must also plot each row
        For iRowCount = 1 To 1 'tempview1.MSFlexGrid1.Rows - 2 
            ' assign a FlexGrid cell's data to dCurrData
            ' a FlexGrid's column and row indices begin at 0,
            ' so you have to compensate...
            dCurrData = tempview1.MSFlexGrid1.TextMatrix(iRowCount, iColumnCount) 'x value             
            ' MSChart's SetData method allocates dCurrData to the chart's current cell            
  MSChart1.DataGrid.SetData iRowCount, iColumnCount, dCurrData, False   error here
        Next iRowCount
    Next iColumnCount
    MSChart1.Visible = True
    ' repaint the chart
    MSChart1.Repaint = True
   ' clicking the chart will now not produce any ugly lines:
    MSChart1.Enabled = False
please help!