F
felix
hi there,
i have tried several ways of trying to get this dynamice range to work
with my chart. each time i have tried a different error, but this is
the current versio, and the current error is:
Application-defined or object-defined error.
if anyone could shed some light on this for me, it would be muchly
appreciated.
The Code:
' draw the graph of the imported data
Graph:
sName = Sheets(Sheets.Count).Name
Set rng = Range("D6").Offset(s, 1)
Charts.Add
ActiveChart.ChartType = xlXYScatterLinesNoMarkers
ActiveChart.SetSourceData Source:=Sheets(sName).Range(rng), _
PlotBy:=xlColumns
ActiveChart.SeriesCollection(1).Name = "=""Crush Data"""
ActiveChart.Location Where:=xlLocationAsObject, Name:=sName
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = sName
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text =
"Displacement (mm)"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Force (kN)"
End With
Range("A1").Select
i have tried several ways of trying to get this dynamice range to work
with my chart. each time i have tried a different error, but this is
the current versio, and the current error is:
Application-defined or object-defined error.
if anyone could shed some light on this for me, it would be muchly
appreciated.
The Code:
' draw the graph of the imported data
Graph:
sName = Sheets(Sheets.Count).Name
Set rng = Range("D6").Offset(s, 1)
Charts.Add
ActiveChart.ChartType = xlXYScatterLinesNoMarkers
ActiveChart.SetSourceData Source:=Sheets(sName).Range(rng), _
PlotBy:=xlColumns
ActiveChart.SeriesCollection(1).Name = "=""Crush Data"""
ActiveChart.Location Where:=xlLocationAsObject, Name:=sName
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = sName
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text =
"Displacement (mm)"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Force (kN)"
End With
Range("A1").Select