E
E
Evgeny Ivanov2020-08-17 01:30:13
Delphi
Evgeny Ivanov, 2020-08-17 01:30:13

TXLSReadWriteII5 - How to set a color for a row/cell?

I am using TXLSReadWriteII5. You need to set an arbitrary color for cells in Excel.

Tried that - doesn't work.

XLS[0].Rows[1].FillPatternForeColor:=xcGray25; //Не работает и не понятно какой цвет xcGray25 в RGB HEX и т.д...

[Error] Unit1.pas(1023): Undeclared identifier: 'xcGray25'
I didn't find any information on the Internet. (

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Tsvetkov, 2020-08-17
@tsklab

Because next to

type TExcelColor = (xc0,xc1,xc2,xc3,xc4,xc5,xc6,xc7, 
                    xcBlack,xcWhite,xcRed,xcBrightGreen,xcBlue,xcYellow,xcPink,xcTurquoise, 
                    xcDarkRed,xcGreen,xcDarkBlue,xcBrownGreen,xcViolet,xcBlueGreen,xcGray25,xcGray50, 
                    xc24,xc25,xc26,xc27,xc28,xc29,xc30,xc31, 
                    xc32,xc33,xc34,xc35,xc36,xc37,xc38,xc39, 
                    xcSky,xcPaleTurquois,xcPaleGreen,xcLightYellow,xcPaleSky,xcRose,xcLilac,xcLightBrown, 
                    xcDarkSky,xcDarkTurquois,xcGrass,xcGold,xcLightOrange,xcOrange,xcDarkBlueGray,xcGray40, 
                    xcDarkGreenGray,xcEmerald,xcDarkGreen,xcOlive,xcBrown,xcCherry,xcIndigo,xcGray80, 
                    xcAutomatic);

located
const TDefaultExcelColorPalette: array[0..64] of integer = ( 
$000000, $000000, $000000, $000000, $000000, $000000, $000000, $000000, 
$000000, $FFFFFF, $0000FF, $00FF00, $FF0000, $00FFFF, $FF00FF, $FFFF00, 
$000080, $008000, $800000, $008080, $800080, $808000, $C0C0C0, $808080, 
$FF9999, $663399, $CCFFFF, $FFFFCC, $660066, $8080FF, $CC6600, $FFCCCC, 
$800000, $FF00FF, $00FFFF, $FFFF00, $800080, $000080, $808000, $FF0000, 
$FFCC00, $FFFFCC, $CCFFCC, $99FFFF, $FFCC99, $CC99FF, $FF99CC, $99CCFF, 
$FF6633, $CCCC33, $00CC99, $00CCFF, $0099FF, $0066FF, $996666, $969696, 
$663300, $669933, $003300, $003333, $003399, $663399, $993333, $333333, 
$FFFFFF);
it is logical to assume that these are these colors.
Yes, all these constants and types are defined in BIFFRecsII2.pas . Don't forget to add it to uses.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question