Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default RGB Colours in Excel 2003

Hello,

Strange problem this, I am able to get RGB colours to work in Excel from
Excel VBA.

But when I run the same code from my VB DLL it runs into the 56 colour
palette problem and all the colour go all over the place.

Anybody knows why this is happening?

please remove nospamplease from email address

Regards

David


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default RGB Colours in Excel 2003

Hi David,

Not quite sure what you are doing. However most "things"
in Excel can only be formatted with an index that relates
to a particular position on the palette, ie a ColorIndex.
The format then displays whatever colour is currently
assigned to this index.

If you apply an RGB colour, Excel will calculate (with a
not very good algorithm) the best match of the palette
colours, then apply the ColorIndex to which this closest
colour is assigned to.

As the palette only contains 56 colours, the chances of
one being the same as any of the 16,777,216 possible
colours you might be trying to apply is remote (unless one
of the "common" colours).

If you want to apply a colour that does not exist in the
palette, you need to customize one of the palette colours,
manually or programmatically.

Some things, such as drawing shapes, can be directly RGB
formatted, rather than formatted with a palette colour.

Regards,
Peter

-----Original Message-----
Hello,

Strange problem this, I am able to get RGB colours to

work in Excel from
Excel VBA.

But when I run the same code from my VB DLL it runs into

the 56 colour
palette problem and all the colour go all over the place.

Anybody knows why this is happening?

please remove nospamplease from email address

Regards

David


.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I use different colours in drop down menus in Excel 2003? mbdixon Excel Discussion (Misc queries) 4 October 29th 09 10:00 PM
Excel 2003 & cell fill colours Tony McGee Excel Discussion (Misc queries) 2 January 14th 08 10:42 AM
My colours in the palette disappear at time when using Excel 2003 Jo Excel Discussion (Misc queries) 0 October 15th 05 07:55 PM
Can't get sensible clear colours in Excel 2003 chrisco Excel Worksheet Functions 1 September 22nd 05 04:44 PM
Excel 2003 font colours and cell colours bretta Excel Discussion (Misc queries) 1 April 17th 05 03:45 AM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"