Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default 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
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
Macro to set cell interior color? imoose Excel Discussion (Misc queries) 4 July 8th 08 11:36 PM
Cell interior color JohnB Excel Discussion (Misc queries) 4 October 12th 06 06:07 PM
Need Excel Formula/Function to color cell interior akaster Excel Worksheet Functions 2 April 19th 06 06:30 PM
Interior Cell color Pellechi Excel Programming 1 September 23rd 03 03:39 PM


All times are GMT +1. The time now is 11:51 AM.

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

About Us

"It's about Microsoft Excel"