Free Support Forum -

Aspose.Cells System.IndexOutOfRangeException: Index was outside the bounds of the array while saving the document

Dear Aspose team,

We have an .xls file that we try to save as .xlsx, but we run into a System.IndexOutOfRangeExeption error message: ‘Index was outside the bounds of the array’.
I am attaching a .pdf file with the occured error, and the version of Aspose.Cells that we are using (and also my observation, where the error may occure).AsposeCellsSaveBug.pdf (152.0 KB)

I am also attaching the document, which resulted the (44.4 KB)

The code what i used is simple:

Workbook doc = new Workbook(inputFilePath)
if (saveOptions == null)
doc.Save(outputFilePath, saveOptions);

but with a simple doc.Save(filePath, SaveFormat.Xlsx); we get the same error message.

This is a quite blocking issue for us. If you could provide any workaround or a quick fix for this, that would be highly appreciated.
Please let us know if we can provide any more details to help you fix this issue.

Best regards,
Bordi Tamás


Thanks for the template file, screenshot and sample code.

After an initial test, I am able to observe the issue as you mentioned by saving your template XLS file as XLSX file format. I found an exception “System.IndexOutOfRangeException: Index was outside the bounds of the array” while saving the document.
Sample code:

Workbook doc = new Workbook(inputFilePath) 

I have logged a ticket with an id “CELLSNET-46293” for your issue. We will look into it soon.

Once we figure it out or we have other updates, we will let you know here.


This is to inform you that we have fixed your issue CELLSNET-46293 now. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.


Please try our latest version/fix (attached): Aspose.Cells for .NET v18.8.2

Your issue should be fixed in it.

Let us know your feedback.
Aspose.Cells18.8.2 For .Net2_AuthenticodeSigned.Zip (4.6 MB)
Aspose.Cells18.8.2 For .Net4.0.Zip (4.6 MB)

The issues you have found earlier (filed as CELLSNET-46293) have been fixed in Aspose.Cells for .NET v18.9. This message was posted using BugNotificationTool from Downloads module by Amjad_Sahi


The issue still persists, even if we upgraded to 18.9.
Please look into this.



I did test using the sample code (in the post) with v18.9, it works fine with the original file (shared by gergelyv).

It looks like you are using some other file for your scenario/case, is not it? If this is the case, kindly do provide us your template file and paste your sample code to show the issue, we will check it soon.