We have come across a problem with one of our larger files. This Excel file contains just over 39,000 rows and is 18 columns wide. File size is roughly 10MB.
Here are some additional notes regarding how we are using the product:
- Aspose is using the PutValue() method to populate the file.
- We are running AutoFitColumn() on each column before calling Save()
- We are using Microsoft Office Excel 2003 to open these files.
Here is how we reproduce the error:
1) Our application uses Aspose.Excel to generate the Excel file and save it to disk.
2) We open the new file in Excel, preview the data, and then close it without making any changes.
3) We are prompted to "Save Changes....[since] Excel recalculates formulas when opening files last saved by an earlier version of Excel...", but we say NO.
4) We try to open the file again, but we get the following error:
'[Filename]' cannot be accessed. The file may be read-only, or you may be trying to access a read-only location.
At this point, the file appears corrupt and will not open.
Now, if we choose to Save the file after opening it for the first time, then everything works fine and we are able to open it again & again without issue.
It seems this only happens with large files. The smaller files (several thousand rows) can be opened, closed without saving even though it still prompts you to Save with the same message I posted above, and then opened again without issue.
Our question, do we need to manually open and re-save these larger files so we don't run into the problem of a customer opening the file for the first time, closing without saving, and then being unable to open it again? If so, at what point [filesize/rowcount] do we need to consider doing this?