 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Glenn P Guest
|
Posted: Sun May 13, 2007 3:00 am Post subject: Excel Fill Color from Delphi |
|
|
Hello,
Can someone please provide an example or tell me how to change the fill
color for a cell / row / column in Excel from Delphi.
Thanks in advace,
Glenn |
|
| Back to top |
|
 |
Oliver Townshend Guest
|
Posted: Sun May 13, 2007 5:37 am Post subject: Re: Excel Fill Color from Delphi |
|
|
| Quote: | Can someone please provide an example or tell me how to change the fill
color for a cell / row / column in Excel from Delphi.
|
The simplest way to work these things out is to either search google for
examples or to record a macro:
With Selection.Interior
.ColorIndex = 8
.Pattern = xlSolid
End With
So in Delphi, it's
with WS.Selection.Interior begin
ColorIndex :=8;
Pattern := xlSolid;
end;
I searched for interior in the Excel Object Browser and found that it's also
a property of a range. The example they give is:
Worksheets("Sheet1").Range("A1").Interior.ColorIndex = 3
So this can be translated fairly easily too.
Oliver Townshend
Oliver Townshend |
|
| Back to top |
|
 |
Mike Shkolnik Guest
|
Posted: Sun May 13, 2007 5:44 pm Post subject: Re: Excel Fill Color from Delphi |
|
|
xls.ActiveSheet.Cells[yourRow, yourCol].Interior.Color :=
ColorToRGB(yourColor);
or
xls.ActiveSheet.Columns[yourColumn+i].Interior.Color :=
ColorToRGB(yourColor);
or
xls.ActiveSheet.Rows[yourRow+i].Interior.Color := ColorToRGB(yourColor);
--
With best regards, Mike Shkolnik
Scalabium Software
http://www.scalabium.com
mshkolnik (AT) scalabium (DOT) com
"Glenn P" <glenn.parisi (AT) london (DOT) net> wrote in message
news:46463906$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Hello,
Can someone please provide an example or tell me how to change the fill
color for a cell / row / column in Excel from Delphi.
Thanks in advace,
Glenn
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|