Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / February 2007

Tip: Looking for answers? Try searching our database.

Excel Color Palette problem ...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sto - 17 Jan 2006 11:27 GMT
Hi to all,

I have a very strange problems with colors.

I have a program that does some database reports and brings those report to
the  user. Then the user can print and export to excel /using 3rd party
components/. Everything is going ok, except when using custom colors for the
grid background.
Then some odd colors are used when the report is opened with Excel, not the
colors I defined.

I searched the newsgroups and found out that there is a DefaultColorPalete
thing.
Then I found:
http://www.mvps.org/dmcritchie/excel/colors.htm

I tested with this color list, it seems only the first 8 colors are ok,
while the next 8 are not.
Here is the list I used (from the link above):
$000000,$FFFFFF  ,$FF0000 ,$00FF00,$0000FF, $FFFF00, $FF00FF,$00FFFF,
$800000,$008000,$000080,$808000,$800080,$008080,$C0C0C0,$808080);

I used Excel97 and 2003 for testing - same strange results for both.

Any suggestion? Please!
Peter T - 17 Jan 2006 12:47 GMT
How did you define and/or apply your custom colours.

All the colours in your list are colours that exist in the default Excel
palette, assigned to the following colorindex's (in same order as your list)

1 18/54 3 4 5 6 7 8
9 10 11 12 13 14 15 16

(18 & 54 colorindex's have same colours in a default palette)

the equivalent "long" colour values are
0, 6697881, 255, 65280, 16711680, 65535, 16711935, 16776960
128, 32768, 8388608, 32896, 8388736, 8421376, 12632256, 8421504

If you have either applied these colorindex's or colour's as formats your
colours should print correctly (subject your printer)

However if you have applied some other RGB colours that do not exist in the
default palette, then colours will map to what Excel calculates is the
closest match to one of the default colours, then apply the colorindex
holding that colour.

You can customize some palette colours as required, then apply either the
relevant colorindex or the RGB value.

Regards,
Peter T

> Hi to all,
>
[quoted text clipped - 21 lines]
>
> Any suggestion? Please!
sto - 17 Jan 2006 14:06 GMT
10x Peter for quick responce.

I am using a 3rd party components, which seems to not treat the color
problem quite well. They do not use COM or OLE for creating the Excel file,
insted they created the file on the fly in binary format (i think it's called
biff8).

The problem was that almost non of the color matched. I searched the forum
about similar problems and replaced thier color palette with the one from the
link above.
It seems to handle the first 8 colors, not the rest. But there might be an
issue with their code, I will have to recheck it again.

But since you confirm the color palette is OK, I will put more efforts on
debuggin the code.

10x again!

> How did you define and/or apply your custom colours.
>
[quoted text clipped - 52 lines]
> >
> > Any suggestion? Please!
Peter T - 17 Jan 2006 15:05 GMT
Something went totally wrong with my transcription of the second colour in
your list -

colorindex 18/54 colour-value 6697881
is in fact
colorindex 2, colour-value 16777215  (#FFFFFF - white)

Your colours are comprise the original "16" video colours

Curiosity - how do your 3rd party components colour format Excel cells
without using COM or OLE.

Regards,
Peter T

> 10x Peter for quick responce.
>
[quoted text clipped - 70 lines]
> > >
> > > Any suggestion? Please!
Tom Ogilvy - 17 Jan 2006 16:59 GMT
Didn't he say they wrote a Biff8 file - just like Excel/any workbook file,
it would include information on the formatting of the cells.

Signature

Regards,
Tom Ogilvy

> Something went totally wrong with my transcription of the second colour in
> your list -
[quoted text clipped - 98 lines]
> > > >
> > > > Any suggestion? Please!
Peter T - 17 Jan 2006 20:39 GMT
Ah, of course. Thanks.

Regards,
Peter T

> Didn't he say they wrote a Biff8 file - just like Excel/any workbook file,
> it would include information on the formatting of the cells.
[quoted text clipped - 112 lines]
> > > > >
> > > > > Any suggestion? Please!
redruthann - 26 Feb 2007 18:08 GMT
I wanted to thank you for that link to the excel colors.  It was exactly what
I was looking for - just the basics are good enough for me.

Ruth

> Hi to all,
>
[quoted text clipped - 21 lines]
>
> Any suggestion? Please!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.