EAccessViolation when changing FontColor for multiple cells
Posted: Thu Feb 28, 2013 9:10 am
Hi!
I got an EAccessViolation in function TXc12XF.GetFont when changing the FontColor for multiple cells (XLSReadWriteII 5.10.02).
I am not sure but it seems that this error only occurs if I am using the old xls format.
Sample code:
var
ExcelFile5 : TXLSReadWriteII5;
lindex :Integer;
begin
ExcelFile5 := TXLSReadWriteII5.Create(nil);
ExcelFile5.Version := Xc12Utils5.xvExcel97; <---- using old xls format
ExcelFile5.Filename := 'D:\output.xls';
for lIndex := 0 to 1000 do begin
ExcelFile5[0].AsString[0,lIndex] := 'test';
ExcelFile5[0].Cell[0,lindex].FontColor := $5050FF; <------- this results in an EAccessViolation
end;
ExcelFile5.Write;
end;
Any help would be appreciated.
Thank you.
I got an EAccessViolation in function TXc12XF.GetFont when changing the FontColor for multiple cells (XLSReadWriteII 5.10.02).
I am not sure but it seems that this error only occurs if I am using the old xls format.
Sample code:
var
ExcelFile5 : TXLSReadWriteII5;
lindex :Integer;
begin
ExcelFile5 := TXLSReadWriteII5.Create(nil);
ExcelFile5.Version := Xc12Utils5.xvExcel97; <---- using old xls format
ExcelFile5.Filename := 'D:\output.xls';
for lIndex := 0 to 1000 do begin
ExcelFile5[0].AsString[0,lIndex] := 'test';
ExcelFile5[0].Cell[0,lindex].FontColor := $5050FF; <------- this results in an EAccessViolation
end;
ExcelFile5.Write;
end;
Any help would be appreciated.
Thank you.