If the range doesn't contain valid data, some chart types will complain when
you access certain properties of the SeriesCollection object. Your Union may
just be asking for trouble. Also, sometimes Excel parses the range
differently than you'd expect or want when you use SetSourceData. I usually
skip SetSourceData; I add each series separately and define its component
parts independent of other series. See
http://peltiertech.com/Excel/ChartsHowTo/QuickChartVBA.html#addseries
However, I think your problem is more fundamental than that. Looking back on
your original post:
> (name CHT_21QSBA_S = A1,B5,Q3)
You're just begging for trouble. Excel needs nicely shaped ranges for chart
source data. You'd be better off with an unused worksheet range, say
AA1:AA3, with links in these cells to those you tried to associate using the
defined name. Then either assign the name to this range, or simply use the
range as is.
Then combine this nicer data arrangement with my series-by-series chart
building approach above, and explicitly tell Excel which range to use for
the name, values, and xvalues of each series.
- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______
> Hi Jon,
> Still same problem after moved ChartType. Has a stacked column chart
[quoted text clipped - 61 lines]
>> > Kind regards
>> > tskogstrom