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

Free Support Forum - aspose.com

Exception when saving worksheet


The following code:

var workbook = new Workbook();
Worksheet chartSheet = workbook.Worksheets[workbook.Worksheets.Add(SheetType.Chart)];

Results in the following exception:

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at Aspose.Cells.Workbook.Save(String fileName, SaveOptions saveOptions)
at Aspose.Cells.Workbook.Save(String fileName)

I believe it is because of the lack of Chart object on the chart sheet.
This should however not throw an exception; or, if it does, it should be more descriptive.

Best regards.


Thanks for your posting and using Aspose.Cells.

We were able to observe this exception after running your sample code with the latest version: Aspose.Cells
for .NET v8.3.1.4

We have logged this issue in our database for investigation. We will look into it and fix this issue. Once, the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as

  • CELLSNET-43292 - Exception on saving workbook with empty chart sheet


Thanks for your using Aspose.Cells.

Please download and try the latest fix: Aspose.Cells for .NET v8.3.1.6 and let us know your feedback.

The issues you have found earlier (filed as CELLSNET-43292) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by Aspose Notifier.