Error writing empty string on D7

Questions and answers on how to use XLSReadWriteII 5.
Post Reply
mmacedobr
Posts: 2
Joined: Wed Jan 21, 2015 5:12 pm

Error writing empty string on D7

Post by mmacedobr »

When I write cells with empty strings, when I read then back they have the content #$D (carriage return).
I've created a small sample code to reproduce the problem, I'm using Delphi 7 and XLSRW version 5.20.41

xlsRW.Clear;
xlsRW.Version := xvExcel2007;
xlsRW[0].AsString[1, 0] := '';
xlsRW.Filename := 'c:\TestSheet.xlsx';
xlsRW.Write;

xlsRW.Clear;
xlsRW.Version := xvExcel2007;
xlsRW.Filename := 'c:\TestSheet.xlsx';
xlsRW.Read;
if xlsRW[0].AsString[1, 0] <> '' then
begin
Application.MessageBox('Something wrong happened writing an empty string', 'XLS Error');
end;
Post Reply