If you take your FormatCells sample and add the following lines in the btnDefaultFormatClick event, the borders never appear (i use XLS.Version := xvExcel97).
Code: Select all
// Create second default format.
XLS.CmdFormat.BeginEdit(Nil);
XLS.CmdFormat.Fill.BackgroundColor.RGB := $FF1010;
XLS.CmdFormat.Font.Name := 'Arial';
XLS.CmdFormat.Font.Color.IndexColor := xcWhite;
XLS.CmdFormat.Border.Color.IndexColor := xcBlack; <= line added for testing borders
XLS.CmdFormat.Border.Style := cbsThick; <= line added for testing borders
XLS.CmdFormat.Border.Preset(cbspOutline); <= line added for testing borders
XLS.CmdFormat.AddAsDefault('F2');
So what is the way to set borders in default formats ?
Thanks for your help.