Page 1 of 1

Create and Save .XLS file ( not XLSX ) at runtime

Posted: Tue May 31, 2016 7:27 am
by a.menghini
Hi Support,
I try to create runtime and save an XLS file in version 97 but when I write it the file is XLSX type.

Code: Select all

   xls := TXLSReadWriteII5.Create( nil );
   try
        xls.Version := xvExcel97;
        xls.Filename := 'C:\Test.xls';
        xls.Add;
        xls.Sheets[ 0 ].AsString[ 0, 0 ] := 'D_TRANSAZIONE';
        xls.write
   finally
      FreeAndNil( xls );
   end;
Can you help me ?

thanks

Alberto

Re: Create and Save .XLS file ( not XLSX ) at runtime

Posted: Tue May 31, 2016 12:01 pm
by larsa
Hello

Your code works correct. It creates an XLS file.

Re: Create and Save .XLS file ( not XLSX ) at runtime

Posted: Wed Oct 05, 2016 3:18 pm
by soptimkrze
Hello,

we have the same problem with the version 5.20.79, I have set version to 97 before I call the write function.
When Excel opens the file, it signalises that the file has a wrong extension. This warning is correct, it's xlsx!

What is the problem / solution?

Best regards,
JP

Re: Create and Save .XLS file ( not XLSX ) at runtime

Posted: Wed Oct 05, 2016 7:46 pm
by larsa
Hello

Don't know. I get an XLS file if I uses the code above.