Problem concerning TXLSReadWriteII5.Version property

Questions and answers on how to use XLSReadWriteII 5.
Post Reply
phen
Posts: 1
Joined: Thu Mar 27, 2014 8:23 am

Problem concerning TXLSReadWriteII5.Version property

Post by phen »

Hello,

After switching from XLSReadWrite Version 4 to Version 5 I can observe the following:
-Occurs in Delphi 2007 and Delphi XE5
-XLS : TXLSReadWriteII5
-In RAD Studio the XLS.Version property is set to xvExcel97
-I read information from an Excel 97 file as before, e.g. XLS.Read, process the information, and after that is done just call

Code: Select all

 XLS.Clear
-Then at some point I want to save the alteration by deleting the old file an completely build a new one and here the problem occurs; In that order :

Code: Select all

 
XLS.Clear;
// XLS.Version :=  Xc12Utils5.xvExcel97; // Workaround for a correct .xls file
XLS.Sheets[0].As....; //put information in Sheet "0" 
XLS.Filename := example.xls; //set correct filename for Excel 97 file
XLS.Write;
XLS.Clear;
-Builds a file with .xls fileextension but Excel itself tells you it´s broken but opens it nevertheless because it´s actually an Excel 2007 file (.xlsx) with a wrong fileextension
-The workaround helps but it´s ugly and I don´t want to keep it there because I know myself and I´m pretty much sure I´ll forget that I put that specific line therein which will cause problems

Is this a bug that will be fixed? I need to know if I have to redesign this.

Greetings
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Problem concerning TXLSReadWriteII5.Version property

Post by larsa »

Hello

I can't reproduce this. When I test your code, I get the expected file, XLS/Excel 97.
Lars Arvidsson, Axolot Data
Post Reply