SST is NIL while trying to create borders

Questions and answers on how to use XLSReadWriteII 5.
Post Reply
DrTob
Posts: 20
Joined: Tue Jul 19, 2011 2:31 pm

SST is NIL while trying to create borders

Post by DrTob »

I try to create borders around some cells with the following code:

Code: Select all

0:    FSheet.AsString[x,y] := ''; //"Create" cell
1:    MakeBorder(FSheet.Cell[x,y]);

procedure TqsmComarisonViewXLSExport.MakeBorder(const ACell: TXLSCell);
begin
2:    ACell.BorderLeftStyle := cbsThin;
3:    ACell.BorderLeftColor := xcGray50;
4:    ACell.BorderBottomStyle := cbsThin;
5:    ACell.BorderBottomColor := xcGray50;
6:    ACell.BorderTopStyle := cbsThin;
7:    ACell.BorderTopColor := xcGray50;
8:    ACell.BorderRightStyle := cbsThin;
9:    ACell.BorderRightColor := xcGray50;
end;
I get an exception at row 8: 'SST String is Nil'. This exception occours always at the fourth/last border. Changing the order does not have any effect.
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: SST is NIL while trying to create borders

Post by larsa »

Hello

When formatting cells, use the CmdFormat object. Please study the FormatCells sample for more details.
Lars Arvidsson, Axolot Data
Post Reply