We help IT Professionals succeed at work.
Get Started

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

Don OHara
Don OHara asked
Last Modified: 2019-12-29
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
Watch Question
Mechanical Engineer
Most Valuable Expert 2013
Distinguished Expert 2020
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE