I was in need to export some data to an excelapplication, and set the backgroud of some cells to a given color

the visual basic syntax is:

selection.interior.color = rgb(r,g,b)

but I have not figured out how to receive a color value from excel to pass it again to excel to set the color of selected cells.

I have found on an empiricist way a workaround, calculating a numeric value form the three colors and passing it to to excel to set the color, but I am just curious to know if there is a way to receive a value from a vb function such as rgb() and use it.

thank you,

       Giulio

PS:
for those who may be concerned, a strange Excel behaviour:
I have spent a couple of hours trying to understand why some cells colors looked always a bit different than the color I set them, then after some internet search I discovered that you can set a cell color to an rgb value using visual basic, but the resulting color of the cell will not be that rgb value but its closest match in the Excel colors palette.

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to