Formulas and ranges go lost when just reading/writing an xls

Questions and answers on how to use XLSReadWriteII 3/4/5.
Post Reply
Mohrhagen
Posts: 1
Joined: Fri Jul 07, 2017 8:28 am

Formulas and ranges go lost when just reading/writing an xls

Post by Mohrhagen »

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:

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;
When opening '20141102 Template - copied -.xls' all Excel displays the following error message:

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>
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!
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Formulas and ranges go lost when just reading/writing an xls

Post by larsa »

Hello

Please test this with version 6 (you can download a demo from our site). We will only update the current version.
Lars Arvidsson, Axolot Data
Post Reply