S
srinivas
Hi all,
I am Using MS office 2003. I want to create chart using VBA. I have
written the folowing function.
Public Function AddChartSheet(ByVal x As Long, ByVal y As Long, ByVal z
As Long)
Sheet1.Activate
Charts.Add
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData Source:=Sheet1.Range(Cells(z + 1, 2),
Cells(x - 1, y - 1)), PlotBy:= _
xlColumns
ActiveChart.Location Where:=xlLocationAsNewSheet
End Function
and calling this function in my main program. But I am geeting and
error "Method of cells of object _Global Failed".
Can any one suggest.
Regards,
Srinivas
I am Using MS office 2003. I want to create chart using VBA. I have
written the folowing function.
Public Function AddChartSheet(ByVal x As Long, ByVal y As Long, ByVal z
As Long)
Sheet1.Activate
Charts.Add
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData Source:=Sheet1.Range(Cells(z + 1, 2),
Cells(x - 1, y - 1)), PlotBy:= _
xlColumns
ActiveChart.Location Where:=xlLocationAsNewSheet
End Function
and calling this function in my main program. But I am geeting and
error "Method of cells of object _Global Failed".
Can any one suggest.
Regards,
Srinivas