View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
L_P L_P is offline
external usenet poster
 
Posts: 1
Default Excel 2007 Chart colorindex?


I've got something similar under pre-2007, but rather than assigning an
explicit color value to the bars in my graph, I'm taking the value from
a specific cell. (This allows the user to configure the graph's
appearance).

This code works (or has under the pre-2007 versions I've tried it on):


Code:
--------------------

With <path.SeriesCollection(SeriesName)
.Interior.Pattern = Target.Interior.Pattern
.Interior.PatternColorIndex = Target.Interior.PatternColorIndex
.Interior.ColorIndex = Target.Interior.ColorIndex
End With

--------------------


Here, SeriesName holds the name of the data series being changed, and
Target is the Range (from the Excel sheet) which holds the desired
format.

But this is not working under 2007.

There appear to be 2 problems:


1) It doesn't want to accept SeriesName as a valid selector for
SeriesCollection. When I replace the variable with the explicit string
it works fine (e.g. replace the variable SeriesName with "Series1"),
even when that explicit string is the exact value of the string
variable. Is there some new flag to add?


2) The color doesn't change properly.

Now, I assume this is because, under 2007, the graph's colors are being
computed from different fields - RGB, ForeColor, etc. (As suggested by
the examples above).

How do I, under 2007, pick up the "fill" information out of the Target
range (background color and pattern) and apply that to the Series in the
graph?


thanks,
LP


--
L_P
------------------------------------------------------------------------
L_P's Profile: 1286
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=157914

Microsoft Office Help