Page 1 of 1

Can we convert a xls file to xlsx file in XLSReadWriteII4

Posted: Tue Dec 31, 2013 7:55 am
by bennylan
Hi,

Is it possible to convert a xls file (created in excel 2003) to xlsx file by using XLSReadWriteII 4? Thanks in advance.

Re: Can we convert a xls file to xlsx file in XLSReadWriteII4

Posted: Tue Dec 31, 2013 8:16 am
by larsa
Hello

Probably not. Version 4 has very poor support for xlsx files.

Re: Can we convert a xls file to xlsx file in XLSReadWriteII4

Posted: Thu Jan 02, 2014 1:41 am
by bennylan
Thanks Larsa. Then i tried it in XLSReadWriteII 5, it seems okay, am i right?

Code: Select all

var
  xlsApp: TXLSReadWriteII5;
  fs: TFileStream;
begin
  xlsApp := TXLSReadWriteII5.Create(nil);
  try
    fs := TFileStream.Create('C:\Users\Benny\Desktop\test.xls', fmOpenRead);
    try
      xlsApp.LoadFromStream97(fs);
      xlsApp.SaveToFile('C:\Users\Benny\Desktop\test.xlsx');
    finally
      fs.Free;
    end;
  finally
    xlsApp.Free;
  end;
end;

Re: Can we convert a xls file to xlsx file in XLSReadWriteII4

Posted: Fri Jan 03, 2014 10:39 am
by larsa
Hello

It's enough to set:

Code: Select all

XLS.Version := xvExcel2007;