Color for chart series auto-assigned after 56?

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
 
C

cmoran

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
 
C

Chip Pearson

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
 
C

cmoran

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
 
J

JE McGimpsey

Don't know if this is germane, but for MacXL2004, the XL-assigned colors
start with series #49, not 57.
 
C

cmoran

Debra-
Your solution of adding the xlSolid line works perfectly. Thank
much!
Crai
 
D

Debra Dalgleish

Well, we can't make our charts transparent, but at least we can have 60
series in solid white!
 
J

JE McGimpsey

The workaround for MacXL is to recolor the series after creating them.
So we *can* have 60 transparent white series!
 
J

Jon Peltier

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top