Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

Unable to set ColorIndex Property

Mar 22, 2004 11:47PM PST

I keep getting error 1004 Unable to set ColorIndex
Property with this code : -

cht.SeriesCollection("P1").Interior.ColorIndex = 4

Any clues?

Mike Collard

Discussion is locked

- Collapse -
Re:Unable to set ColorIndex Property
Mar 23, 2004 6:32PM PST

got the answer elsewhere. In a line graph a line does not have an Interior method - it has a Border!

- Collapse -
Re: Unable to set ColorIndex Property
Jul 4, 2004 11:50PM PDT

One of the causes of error message "1004 Unable to set ColorIndex Property" is exceeding the approximate 4000 formats limit per workbook. Color is a format. When I first encountered this message, it was not consistent. One time it the code worked and later it gave the above error message. In my situation, I solved it by having my macro open new workbook and close the old one before the 4k format limit per worksheet was reached.

A related error message also caused by too many formats is
"XL: Error Message: Too Many Different Cell Formats"

See Microsoft Knowledge Base (MKB) 213904
'http://support.microsoft.com/default.aspx?scid=kb;en-us;Q213904