Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem in setting Cell Interior Color filling.
Hi,
I am calling Excel from my Application. The code was developed in Borland C++ and I am making OLE call to set properties to the Excel. When I say Cell.OlePropertyGet("Interior").OlePropertySet("Co lor", RGB(164,224,224)); it assigns some other color, the RGB value of the assigned color is RGB(153, 204, 255). I dont want the user of this application to change the color form excel and every thing should happen from my code only. Any help is appreciated. Thanks in advance. With Regards Venkat |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem in setting Cell Interior Color filling.
Hi Venkat,
You are trying to apply a colour that does not exist in the current palette of 56. So, Excel calculates what it thinks is the nearest "existing" colour and applies the associated Colorindex. In a Default palette the "nearest" colour to RGB(164,224,224) is indeed RGB(153, 204, 255), namely Colorindex 37. If you specifically want "your" colour, first you need to customize one of the palette colors, like this: Activeworkbook.colors(X) = RGB(164,224,224) where X is a number 1 to 56 If "maybe" your colour already exists in the palette, follow this logic to avoid unnecessarily customizing: SomeFormat = MyRGB If SomeFormat < MyRGB then custmize a colour (as above) SomeFormat = MyRGB 'try again EndIf Customized colour(s) are saved with the workbook. Regards, Peter -----Original Message----- Hi, I am calling Excel from my Application. The code was developed in Borland C++ and I am making OLE call to set properties to the Excel. When I say Cell.OlePropertyGet("Interior").OlePropertySet ("Color", RGB(164,224,224)); it assigns some other color, the RGB value of the assigned color is RGB(153, 204, 255). I dont want the user of this application to change the color form excel and every thing should happen from my code only. Any help is appreciated. Thanks in advance. With Regards Venkat . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to set cell interior color? | Excel Discussion (Misc queries) | |||
Cell interior color | Excel Discussion (Misc queries) | |||
Need Excel Formula/Function to color cell interior | Excel Worksheet Functions | |||
Interior Cell color | Excel Programming |