When building a single Excel workbook based on copies of worksheets from multiple source Excel files using Aspose.Cells we are seeing a problem where some styles in the combined workbook appear to get messed up after opening and re-saving the Aspose-generated file in Excel.
We have seen this in:
- Excel: Version 2205 (Build 15225.20288).
- Aspose.Cells: 184.108.40.206 (and some earlier 22.x releases)
We do not see this problem in:
- Excel: same version as above.
- Aspose.Cells: 220.127.116.11
The attached sample Visual C# console application and files should help demonstrate/simulate this problem. If you put a 22.x release of Aspose.Cells.dll in the Content folder you will be able to run the application.
AsposeCorruptStylesIssue.zip (100.7 KB)
The sample application begins with an “Executive - Section Inserts.xlsx” workbook as a starting point. A copy of its only worksheet is made and then renamed, removing the original. Worksheets from other workbooks are duplicated, renamed, and copied into the combined workbook. The combined workbook (with 5 total worksheets) is then saved with the name “Full Report Package.xlsx”. The generated output file gets created in: \bin\Debug\net6.0\Content
To reproduce the problem:
- Run this sample console application and then open the generated “Full Report Package.xlsx” Excel workbook in Excel
- Take a screenshot of the bottom right sections of the “Select Company” and “Select-Projection” worksheets for the 2 “Projected Metrics” summaries (example below).
- Save the file in Excel (changing nothing).
- Close the file.
- Reopen the file again in Excel and check those same bottom right summaries in the 2 sheets against screenshots from step 2 (example below).
You should see something related to the formatting/styles change with one or both sheets’ summary sections.
Here is an example of what I see before & after (you may see other differences-- this doesn’t always seem consistent other than something with Excel styles ends up being displayed incorrectly after the save, close, reopen step):
Let me know if you have any questions.