Formulas and ranges go lost when just reading/writing an xls
Posted: Tue Jul 18, 2017 7:51 pm
I have migrated an application from XLSReadWriteII version 2 to version 5.
After reading a *.xls file and writing it later on all formulars and ranges are lost. I was able to reproduce the problem with the follwing simplified program:
When opening '20141102 Template - copied -.xls' all Excel displays the following error message:
After letting Excel recover the file, all ranges and formulars are gone. I would have expected an mainly unchanged file.
Doing the same thing with the same file saved as xlsx works just fine.
Can you please advice!
After reading a *.xls file and writing it later on all formulars and ranges are lost. I was able to reproduce the problem with the follwing simplified program:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var
XlsRW5 : TXLSReadWriteII5;
begin
XlsRW5 := TXLSReadWriteII5.Create(nil);
XlsRW5.LoadFromFile('c:\temp\20141102 Template.xls');
XlsRW5.SaveToFile('c:\temp\20141102 Template - copied -.xls');
FreeAndNil(XlsRW5);
end;
Code: Select all
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><logFileName>error054040_01.xml</logFileName><summary>Fehler in Datei 'C:\temp\20141102 Template - copied -.xls'</summary><additionalInfo><info>Excel hat Ihre Formeln und Zellwerte wieder hergestellt, aber einige Daten sind möglicherweise verloren gegangen.</info></additionalInfo></recoveryLog>
Doing the same thing with the same file saved as xlsx works just fine.
Can you please advice!