Color for chart series auto-assigned after 56?

  • Thread starter Thread starter cmoran
  • Start date Start date
C

cmoran

Using Excel 2000, I am having a color issue with charts that exceed 5
series. Below is some sample VBA to reproduce the issue. The cod
creates a bar chart with 60 series. The RGB color I have chosen i
white (255, 255, 255). You will notice that beginning with series 57
the color of the columns no longer gets assigned the color that I want
Excel starts auto-assigning colors at this point. I have reproduce
this faithfully 100% of the time. Has anyone seen this before? I
there a programatic workaround so that I don't have to manually chang
the colors after the fact?
Thanks-
Craig

Sub TestColors()

series_count = 60

Charts.Add
ActiveChart.ChartType = xlColumnClustered
ActiveChart.HasLegend = False

For i = 1 To series_count

ActiveChart.SeriesCollection.NewSeries

With ActiveChart.SeriesCollection(i)
.Name = "Data Series # " & i
.Values = "1"
.Interior.Color = RGB(255, 255, 255)
End With

Next i

End Su
 
I ran this using the Office XP version of Excel and encountered the sam
results. Furthermore, I have searched diligently for this issue on th
internet as well as Microsoft's site and encountered no solutions o
anyone else that reported this issue
 
Excel supports only 56 colors. When you assign a value to the
Color property, Excel chooses the closest match from the
available 56 colors.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Try the code. I'm using a single color for more than 56 chart columns.
Your reply indicates that the assumption is that I'm using more than 5
colors which is not the case. I'm stumped on this one
 
Don't know if this is germane, but for MacXL2004, the XL-assigned colors
start with series #49, not 57.
 
Well, we can't make our charts transparent, but at least we can have 60
series in solid white!
 
The workaround for MacXL is to recolor the series after creating them.
So we *can* have 60 transparent white series!
 
Tastes Great - Less Filling

- Jon

JE said:
The workaround for MacXL is to recolor the series after creating them.
So we *can* have 60 transparent white series!
 
Back
Top