EListError exception when deleting a sheet (v5.10.17)

Questions and answers on how to use XLSReadWriteII 5.
Post Reply
jleg
Posts: 11
Joined: Thu Apr 04, 2013 12:04 pm
Location: France

EListError exception when deleting a sheet (v5.10.17)

Post by jleg »

Hello,

if you execute the code below, you will get an EListError exception.

Code: Select all

XLS.Version := xvExcel97;
XLS.Delete(0);
XLS.Add;
XLS.FileName := 'C:\Test.xls';
XLS.Write;
I think the pb is that in the TXLSWorkBook.Delete method, the FManager.Worksheets.Count is Ok (value = 1) but when you use WritePrepare or WriteToStream method (i don't remember exactly), the FSheets.Count value is 2 so when you access the second sheet that doesn't exist, you get the EListError exception (it's just a start search of course)
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: EListError exception when deleting a sheet (v5.10.17)

Post by larsa »

Hello

This is fixed in 5.10.18
Lars Arvidsson, Axolot Data
Post Reply