EListError exception when deleting a sheet (v5.10.17)
Posted: Wed Apr 17, 2013 5:07 pm
Hello,
if you execute the code below, you will get an EListError exception.
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)
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;