Greetings,
I've been struggling with this for a few hours and need to reach out.
I am creating Excel charts in Access. I have creating an Excel application object (if that's the right terminology) named as "x1". Most of the posts I've seen say to use the "Move after:=x1.Sheets.Count" method to position the Activechart to the last tab. I can't seem to get this to work (all other Excel code DOES work fine).
Here's a snippet of my code:
x1.Charts.Add
'Delete all Series.
With x1.ActiveChart
For i = .SeriesCollection.Count To 1 Step -1
.SeriesCollection(i).Delete
Next i
End With
x1.ActiveChart.Location Where:=xlLocationAsNewSheet
x1.ActiveChart.Move after:=x1.Sheets.Count
'''x1.ActiveChart.Move after:=Sheets(Sheets.Count) 'This line rem'd out.
x1.ActiveChart.ChartType = xlLineMarkers
x1.ActiveChart.HasTitle = True
Thanks for any insight, folks can provide!
Jon Mulder
Engineering Geologist
California Department of Water Resources
I've been struggling with this for a few hours and need to reach out.
I am creating Excel charts in Access. I have creating an Excel application object (if that's the right terminology) named as "x1". Most of the posts I've seen say to use the "Move after:=x1.Sheets.Count" method to position the Activechart to the last tab. I can't seem to get this to work (all other Excel code DOES work fine).
Here's a snippet of my code:
x1.Charts.Add
'Delete all Series.
With x1.ActiveChart
For i = .SeriesCollection.Count To 1 Step -1
.SeriesCollection(i).Delete
Next i
End With
x1.ActiveChart.Location Where:=xlLocationAsNewSheet
x1.ActiveChart.Move after:=x1.Sheets.Count
'''x1.ActiveChart.Move after:=Sheets(Sheets.Count) 'This line rem'd out.
x1.ActiveChart.ChartType = xlLineMarkers
x1.ActiveChart.HasTitle = True
Thanks for any insight, folks can provide!
Jon Mulder
Engineering Geologist
California Department of Water Resources