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

Questions and answers on how to use XLSReadWriteII 5.
Post Reply
a.menghini
Posts: 18
Joined: Thu Aug 26, 2010 7:26 am

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

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

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

Post by larsa »

Hello

Your code works correct. It creates an XLS file.
Lars Arvidsson, Axolot Data
soptimkrze
Posts: 1
Joined: Wed Oct 05, 2016 3:11 pm

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

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

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

Post by larsa »

Hello

Don't know. I get an XLS file if I uses the code above.
Lars Arvidsson, Axolot Data
Post Reply