I use Aspose.Excel 2.7.1 to create excel files with many worksheets in them. A typical file may have 150-200 worksheets. My customer generated a file with 400+ worksheets and is unable to open the output file in Excel 2000.
I also tried to open the file in Excel 2003 and it opens but generates a repair log with the following text in it... ------------------------------------ Microsoft Excel File Repair Log
Errors were detected in file 'D:\1.xls' The following is a list of repairs:
Removed one or more invalid names. ------------------------------------ I also installed the latest version (2.9.2) and it gives me a duplicate Print_Area popup prior to opening the file and creating a repair log.
A designer file is used which contains 11 sheets. Each sheet is copied 0+ times depending on user selected options and then saved to an output file.
Any ideas what is happening with the larger files?
I emailed you the designer and output files. When I open the output file the following repair log is generated in Excel 2002… ------------------------------------------------- Microsoft Excel File Repair Log
Errors were detected in file ‘D:\WebContent\ABMS210\reports\ExcelExhibitBuilder_127555818500325280.xls’ The following is a list of repairs:
Damage to the file was so extensive that repairs were not possible. Excel attempted to recover your formulas and values,
but some data may have been lost or corrupted. ------------------------------------------------
Could you please try to see if the following code works fine in your machine? Excel excel = new Excel();
excel.Open("d:\\test\\Exhibits.xls");
Excel excel2 = new Excel();
for( int i = 0; i < excel.Worksheets.Count; i ++) { excel2.Worksheets.Copy(excel.Worksheets); if(i != excel.Worksheets.Count - 1) excel2.Worksheets.Add(); }
for( int j = 0; j < 40; j ++) { for( int i = 0; i < excel.Worksheets.Count; i ++) { excel2.Worksheets.Add(); excel2.Worksheets[i + (j + 1)* excel.Worksheets.Count].Copy(excel.Worksheets); } }
When I run the code using 2.7.1 I get the following error… ------------------- An unhandled exception of type ‘System.Exception’ occurred in aspose.excel.dll
Additional information: The same worksheet name already exists -------------------
When I run the code using 2.9.2 it generates the attached file. I don’t use any formulas.
Could you post some sample code here? I don't need the exact code for data manipulation. I only want the code about coping worksheet, removing worksheet, adding worksheet and other worksheet related operations. Thank you very much.
I tried the code you provided above with the 2.9.2.2 hotfix and I get a popup when I try to open the file in Excel 2002… ----------------------------- Name Conflict Name cannot be the same as built-in name. Old name: Print_Area New name: [input box] [OK] [Cancel]
Any idea why this popup comes up? I’ve seen it each time I generate a file with 2.9.2 and try to open the file. I’ve attached the output file.
I’ll also try the patch with my code and let you know what happens.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.