![]() |
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 |
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 . |
All times are GMT +1. The time now is 01:12 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com