ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA with EXcel 2000 and series line colors (https://www.excelbanter.com/excel-programming/287266-vba-excel-2000-series-line-colors.html)

Ed Ulle

VBA with EXcel 2000 and series line colors
 
I am unable to set the line colors of a chart object with
multiple series.

For Each series in chart.SeriesCollection
series.Interior.Color = RGB(0,0,0)
Next

Error message reads "Unable to set the Color property of
the Interior class".

The chart is simply an xy scatter with multiple series
created and displayed properly but each series has a
different color. I want all series to be black.


Andy Pope

VBA with EXcel 2000 and series line colors
 
Hi Ed,

Probably because the line doesn't have a interior but a Border.

revised code:

For Each Series In ActiveChart.SeriesCollection
Series.Border.Color = RGB(0, 0, 0)
Next

On a personal note, I would use variable names that aren't the same as
VBA object types. Using Series could get very confusing.

Ed Ulle wrote:

I am unable to set the line colors of a chart object with
multiple series.

For Each series in chart.SeriesCollection
series.Interior.Color = RGB(0,0,0)
Next

Error message reads "Unable to set the Color property of
the Interior class".

The chart is simply an xy scatter with multiple series
created and displayed properly but each series has a
different color. I want all series to be black.


--

Cheers
Andy

http://www.andypope.info


Edward Ulle

VBA with EXcel 2000 and series line colors
 

Andy,

Thanks, it worked.

I would never have associated Border with the line series. I would
think it was the chart border.

Ed


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


All times are GMT +1. The time now is 01:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com