When building a single Excel reporting package using Aspose.Cells based on multiple copies of worksheets from multiple source Excel files, it appears that you can end up with a workbook that can crash Excel (window just disappears). Have seen this in a recent version of Excel: Version 2205 (Build 15225.20288).
The attached sample Visual C# console application and files should help demonstrate/simulate this problem which I have seen in testing with several 22.x Aspose.Cells versions (most recently 22.6.1), but not in older Aspose.Cells versions like 21.7.6. If you put a 22.x release of Aspose.Cells.dll in the Content folder you should be able to run the application.
AsposeCorruptStylesAndFileIssue.zip (99.5 KB)
The sample application begins with a Cover Page.xlsx workbook as a starting point. A copy of its only worksheet is made and then renamed, removing the original. The worksheet in Report Template.xlsm is then copied multiple times into the main workbook, and this workbook is then saved with a different name (“Report Package.xlsx”). The generated output file should get created in: \bin\Debug\net6.0\Content
If you run this sample application and open the generated “Report Package.xlsx” Excel workbook output in Excel, as you click around the different tabs in the workbook (for instance, clicking back to select the “a” tab) Excel will almost always crash or close the instance of Excel with that file. Excel may generate a repaired copy the generated Excel file the next time you open Excel.
The interesting thing is that if the number of copies of the sheet in the “Report Template” workbook in this example is reduced to fewer than 7 the generated Excel file does not appear to crash/close Excel. But generate 7 or more copies and the file is likely to crash Excel as you click around the various tabs.
One last note is that it seems like the generated workbook may also have incorrect merged styles from both workbooks-- perhaps that is a consequence of Excel’s automatic repair operations on the generated file when Excel crashes, but I wanted to mention it in case it is related.