charts.add error

G

Guest

Im trying to add in a chart using a macro and I am running into the Run-time
error '1004': Method 'Add' of object 'Sheets' failed. My code is as follows:
Charts.Add
ActiveChart.ChartType = xlLineMarkers
ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("C45:G45"),
PlotBy _
:=xlRows
ActiveChart.SeriesCollection(1).XValues = "=Sheet3!R1C2:R1C8"
ActiveChart.Location Where:=xlLocationAsObject, Name:="Sheet1"
With ActiveChart
.HasTitle = False
.Axes(xlCategory, xlPrimary).HasTitle = False
.Axes(xlValue, xlPrimary).HasTitle = False
End With
End Sub

Why is this not working???? Thanks in advance for any help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top