Create bad Excel 2007 .xlsx File (Zlib decompress error)

Questions and answers on how to use XLSReadWriteII 3/4/5.
Post Reply
vga
Posts: 14
Joined: Tue Jul 29, 2008 9:19 pm

Create bad Excel 2007 .xlsx File (Zlib decompress error)

Post by vga »

hello:

My code:

uses BIFFRecsII4,XLSFonts4, XLSReadWriteII4;

procedure TForm1.btn1Click(Sender: TObject);
begin
xls1.Version := xvExcel2007;
xls1.Sheet[0].AsInteger[1,1] := 90;
xls1.Filename := 'c:\aa.xlsx';
xls1.Write;
xls1.Read;
end;

xlsreadwrite version 4.0.0.X

Error Info: "Zlib decompress error"

It createed 'c:\aa.xlsx' file, but I can not open by Excel 2007 ?
Help!
Last edited by vga on Sun Oct 23, 2011 11:57 pm, edited 6 times in total.
vga
Posts: 14
Joined: Tue Jul 29, 2008 9:19 pm

Re: Create Excel 2007 File Error!!

Post by vga »

How to create a Excel 2007 File?
vga
Posts: 14
Joined: Tue Jul 29, 2008 9:19 pm

Re: Create Excel 2007 File Error!!

Post by vga »

with the new version 4.0049 I could not create a good .XLSX file too.

procedure TForm1.btn1Click(Sender: TObject);
begin
xls1.Version := xvExcel2007;
xls1.Sheet[0].AsInteger[1,1] := 90;
xls1.Filename := 'c:\aa.xlsx';
xls1.Write;
end;


it did create 'c:\aa.xlsx' file, but
xls1.Read;

can not work.
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Create Excel 2007 File Error!!

Post by larsa »

Hello

I can't find any problem with your code.
Lars Arvidsson, Axolot Data
vga
Posts: 14
Joined: Tue Jul 29, 2008 9:19 pm

Re: Create Excel 2007 File Error!!

Post by vga »

my ide: delphi xe xlsreadwriteII 4.00.52


procedure TForm1.btn1Click(Sender: TObject);
begin
xls1.Version := xvExcel2007;
xls1.Sheet[0].AsInteger[1,1] := 90;
xls1.Filename := 'c:\aa.xlsx';
xls1.Write;
xls1.read;
end;


it did create 'c:\aa.xlsx' file, but when run to:

xls1.Read;

error occur: "Zlib decompress error"
vga
Posts: 14
Joined: Tue Jul 29, 2008 9:19 pm

Re: Create Excel 2007 File Error!!

Post by vga »

[quote="larsa"]Hello

I can't find any problem with your code.[/quote]

which IDE version?

In delphi XE, the followinf code always says: "Zlib decompress error"


procedure TForm1.btn1Click(Sender: TObject);
begin
xls1.Version := xvExcel2007;
xls1.Sheet[0].AsInteger[1,1] := 90;
xls1.Filename := 'c:\aa.xlsx';
xls1.Write;
xls1.read; // run to here, error occur: "Zlib decompress error"
end;
Post Reply