Avatar of Don OHara
Don OHara

asked on 

addchart2 behavior issues - addchart2 modifies existing charts when creating a new chart

Excel VBA Charting Question.  (Office 365 on W-10)

In one VBA macro I use addchart2 to sequentially create a series of similar charts, each with differentt raw data.
The first chart is perfect.
However, when I create the second chart, the first chart has its data changed to the new data in the second chart.
Then, when I create the third chart, both the first and second charts are changed to the third chart.

I expected that addchart2 would close out (deactivate, unselect) the previous chart before creating a new chart. I have tried 'ActiveChart.Deactivate' but to no avail.

Please advise,

thanks, Don
VBAMicrosoft Excel

Avatar of undefined
Last Comment
byundt

8/22/2022 - Mon