Corrupt spreadsheet after deleting sheets?

Questions and answers on how to use XLSReadWriteII 3/4/5.
Post Reply
BobM
Posts: 5
Joined: Sat Jun 30, 2007 2:29 am

Corrupt spreadsheet after deleting sheets?

Post by BobM »

I have a large Excel 2000 workbook (20 sheets, 130MB). Using XLSReadWriteII v3, I can open the workbook and delete all but the two sheets that I need, resulting in a 20MB file. However, upon opening in Excel 2007, I receive an error message that data is lost, and that the file cannot be repaired.

If I do not delete the sheets, but just use Sheet.Range(0,0,LastCol,LastRow).Delete, then I still get the data lost error message, but the file can be opened - however, the file size is 30MB.

Is any way to tell what is going wrong when I delete these sheets?

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

Post by larsa »

Hello

The problem may be related to what kind of data there is on the sheets.

Do a "binary search" in order to find out where the problem is:

1. Delete half of the sheets.

2. Save the file.

3. Open the file in Excel.

4. If there was an error, delete the other half.

5. If there where no error, continue to delete hlaf of what's left.

6. Continue until there is only one sheet left.
Lars Arvidsson, Axolot Data
Post Reply