Erratic problem in using vba to generate charts

  • Thread starter henry.jablonski
  • Start date
H

henry.jablonski

I have had two occasions recently where a weird "bug" seemed to
occur,.The situation is concerning some code I wrote to generate a
chart based on parameters a user could select.
When I wrote the code - it generated charts without any error
messsages. Then the next morning, there suddenly appeared an extra
series on every chart (a blank one) even though I had not touched the
code overnight.
I removed one of the .newseries instances, and from then it worked ok.
It was if the add chart function also provided the first series for
free (not unlike doing it manually). However just the day before, I
had to add a series for every data string that I wanted to chart.
It has been three weeks since this change had to be made, and I was no
closer in understanding why it changed over night. Today (which is why
I am writing this note) all of a sudden I am getting error messages
that there are too few series to handle the number of data streams
that are present! I had to go into the code and re-add the lines I had
commented out to create now as many series as there were data streams.
The "free" series has suddenly disappeared.
What worries me is that when I distribute this code, at some point it
will change it's behaviour and I will have to send out patches to fix
it. Not a nice thought.
Any idea why this flip flop on how many series are present at the
moment you add a chart? If it is systemic, I could write some code to
get around the problem.
 

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