Page 1 of 1

Colors

Posted: Fri Apr 22, 2011 7:12 am
by JonPedersen
Hi,
I am trying to modify the colors of the cell. I had thought the following code would do the trick:
ExcelColorPalette[1]:=$00F1E5DB; // light blue
with XLSCMI.Sheet[0] do Begin
AsString[0,0]:=CountryEdit.Text;
Cell[0,0].FontSize:=16;
Cell[0,0].FontStyle:=[xfsBold];
Cell[0,0].FillPatternForeColor:= xc1;
.....

the code (which would be suggested by the C++ example on the forum
ExcelColorPalette[xc1]:=$00F1E5DB;
does not compile

I have obviously misunderstood something
best
Jon

Re: Colors

Posted: Thu Apr 28, 2011 8:27 am
by larsa
Hello

ExcelColorPalette uses integer for index, not TExcelColor values. Hence vill the code ExcelColorPalette[xc1]:=$00F1E5DB not compile.
You can however use ExcelColorPalette[Integer(xc1)]:=$00F1E5DB

Re: Colors

Posted: Fri Apr 29, 2011 2:10 am
by JonPedersen
Hi again,
Yes, I have tried that - it does compile and changes the palette, but does not have any effect on the colors in the spreadsheet.
jon

Re: Colors

Posted: Fri Apr 29, 2011 4:36 am
by JonPedersen
Hi,
Found a solution. It works if I for example use xc30 instead of xc1. From reading the code it seems that values less than 8 are not valid.
(see line 2305 in XLSReadWriteII4.pas)
best
Jon