So I am trying to add a secondary axis to the xyScatter plot but i keep getting an error stating objet doesnt support property or method
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlXYScatter
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).Name = "='Sheet2'!$A$9"
ActiveChart.SeriesCollection(1).XValues = "='Sheet2'!$B$9"
ActiveChart.SeriesCollection(1).Values = "='Sheet2'!$C$9"
With Sheets(3).ChartObjects("Chart 8")
.SeriesCollection(1).AxisGroup = xlSecondary (Error Occurs here)
.HasAxis(xlCategory, xlPrimary) = True
.HasAxis(xlCategory, xlSecondary) = True
.HasAxis(xlValue, xlPrimary) = True
.HasAxis(xlValue, xlSecondary) = True
.Axes(xlCategory, xlPrimary).CategoryType = xlAutomatic
.Axes(xlCategory, xlSecondary).CategoryType = xlAutomatic
End With
ActiveChart.SeriesCollection(1).Values = "='Sheet2'!$D$9"
Not sure why this is happening.
Aucun commentaire:
Enregistrer un commentaire