We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Unsaved changes pop up when closing newly created xlsx file


I convert the attached spreadsheetML to xlsx format using the code below. Then I open the document in Excel, do nothing, close it and then the popup appears that there are unsaved changes asking me if I want to save it.

var loadOptions = new LoadOptions( LoadFormat.SpreadsheetML );
var workbook;
using ( var stream = new FileStream( path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite ) )
workbook = new Workbook( stream, loadOptions);

var saveOptions = new XlsSaveOptions( SaveFormat.Xlsx );
_workbook.Save( outputPath, saveOptions );

Could you please tell me what could cause this?

Please find the spreadsheetML attached.
ML_Sum.zip (1.0 KB)



This problem happens because Microsoft Excel recalculates the output Excel file on opening and on saving. So please use this code and set both properties as false. It should fix your issue.


Workbook wb = new Workbook("ML_Sum.xml");
wb.Settings.RecalculateBeforeSave = false;
wb.Settings.ReCalculateOnOpen = false;


it does fix the issue for the simple example I sent, but unfortunately it doesn’t fix our more complex case. Please find the other spreadsheet ML attached.

ClaimsFormulas.zip (3.2 KB)



Thanks for your posting and using Aspose APIs.

We were able to observe this issue as per your description and logged it in our database for investigation and for a fix. Once, the issue is resolved or we have some other news for you, we will let you know asap.

This issue has been logged as

  • CELLSNET-45572 - Opening and closing Output Excel file in Microsoft Excel pops up the message to save changes


Please call Workbook.CalculateFormula() method before as there are no values of some formulas in the xml file:
Sample code:

Workbook workbook = new Workbook(dir + "ClaimsFormulas.xml");
            workbook.Settings.RecalculateBeforeSave = false;
            workbook.Settings.ReCalculateOnOpen = false;

Let us know if you still have any issue.

Thank you.