Xlsb file corrupted when saved first time from aspose workbook


//getting xcel corrupted with pivot table when saving a workbook as xslb first time “workbook.Save(fileName)”;
// When we save as xlsx, reload the file, save 2nd time as xlsb and open xlsb works fine
var xlFile = fileName.Replace(XLSB, XLSX);
//save as xlsx which opens fine
AsposeCells.LoadOptions loadOptions = new AsposeCells.LoadOptions(AsposeCells.LoadFormat.Xlsx) { MemorySetting = AsposeCells.MemorySetting.MemoryPreference };

// load saved xlsx to aspose workbook
using (var xlsx = new AsposeCells.Workbook(inputPathAndFile, loadOptions))
// save xlsb. When opened this file is not corrupted
xlsx.Save(outputPathAndFile, AsposeCells.SaveFormat.Xlsb);



Thanks for your query.

Please share your sample file and code snippet(runnable console application) with us for our testing. We will reproduce the problem and provide our feedback after analysis.


I am attaching the corrupted and non corrupted files.FirstXlsbSaveCorrupt.zip (634.8 KB)



I tried it simply by loading XLSX file and saving it back as XLSB, however no issue is observed when this output XLSB file is opened in Excel 2016. This scenario is tested using latest version Aspose.Cells for .NET 18.11.x and following sample code:

Workbook wb = new Workbook("FirstSaveXlsxWorks.xlsx");

Please try this scenario using latest version and provide your feedback. If still issue is there please send us the console application (runnable) along with the XLSX file for our testing.