View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jon Peltier Jon Peltier is offline
external usenet poster
 
Posts: 6,582
Default Custom colours in charts

So what on earth is the point of allowing RGB colours if it then
completely ignores them?


It is what it is. Excel didn't recognize a continuous palette of colors
until 2007. VBA came along later than Excel's color palette, when RGB was a
standard. The VBA/Excel couple does not completely ignore RGB, it merely
tries to match an RGB to the palette as closely as it can.

And Trendlines will only accept RGB colours, not indexes, so there is no
way to
set them to an exact colour.


This works for me:

activechart.SeriesCollection(1).trendlines(1).bord er.colorindex=3

Does anyone who wants a good looking chart just use something else
instead?


We modify our palette, as I discussed later in my response. And it even
works with trendlines.

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


"DuncanL" wrote in message
...
Jon,

Excel has a palette of 56 colors. When you use RGB to define a color,
Excel
uses the element in the palette which it decides is closes to the RGB you
specify.


So what on earth is the point of allowing RGB colours if it then
completely ignores them? If you're going to provide functions that accept
RGB, it is madness to then cripple that so it is fundamentally useless.
And
Trendlines will only accept RGB colours, not indexes, so there is no way
to
set them to an exact colour.

It does seem a bit odd, given that true colour displays have been around
for many, many years now that Excel is stuck with such a limited palette.
Does anyone who wants a good looking chart just use something else
instead?

I realise that this is not your fault and you can't do anything about it,
but I'm just having a small rant here! ;-)


You could assign the RGB to color in the palette, then use this color
index
to color your chart element.


Well that works sort of works (barring the Trendlines), so thank you for
that.

Thanks for the help


Duncan