Home » Category » Microsoft Visual Basic

Microsoft Visual Basic: "Bad function argument" from datagrid

112| Sun, 11 Nov 2007 06:48:00 GMT| ripit| Comments (0)
Hello
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!
Steve

Keywords & Tags: bad, function, argument, datagrid, microsoft, visual basic, vb

URL: http://www.programmerbase.com/visual-basic/170/
 
«« Prev - Next »» 0 helpful answers below.

Microsoft Visual Basic Hot Answers

Microsoft Visual Basic New questions

Microsoft Visual Basic Related Categories