View Single Post
  #4   Report Post  
Jon Peltier
 
Posts: n/a
Default

The 2042 looks to me like a default, what is used if you specified
nothing. Excel will look at a range, and if there are more rows, it
plots by columns by default. By deleting rows then repeating the
SetSourceData without a parameter, Excel counts rows and columns again,
and comes up with a different result. Now that you're specifying the
PlotBy setting, you control the chart's appearance.

In limited testing I was unable to get a PlotBy value other than 1 or 2;
the default appearance of the chart did produce only these two values.
And default constants like this are usually negative and in the 4000's.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

wrote:

I was able to work around this by implementing a Chart Event class and
catch the Chart_Calculate event. In the event of this bogus PlotBy
value of 2042, we ended up ignoring it. Also, I was able to retain the
Chart PlotBy value in a sheet variable. In the event that I get a
bonified change of the PlotBy parameter (through the UI), I handle that
case in the Chart_Calculate event handler and update my sheet variable
that holds the PlotBy. So, I was able to work around this problem.