Calculating charts on an excel with a number > int.MaxValue can error



When calling chart.Calculate() on a chart that has an axis label with a value greater than int.MaxValue and is displaying Data Labels, the calculation will throw a System.OverflowException : Value was either too large or too small for an Int32.

Repro code:

var format = FileFormatUtil.DetectFileFormat("ChartWithLongNumber.xlsx");

var asposeLoadOptions = new LoadOptions(format.LoadFormat)
	LoadFilter = new LoadFilter(LoadDataFilterOptions.All)

using (var workbook = new Workbook("ChartWithLongNumber.xlsx", asposeLoadOptions))
	foreach (var worksheet in workbook.Worksheets)
		foreach (var chart in worksheet.Charts)

Thanks! (11.0 KB)


We were able to observe the issue but we need to look into it more. We have logged the issue in our database for investigation and for a fix. Once, we will have some news for you, we will update you in this topic.

This issue has been logged as

CELLSNET-46842 - Calculating charts on an excel cause error



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

Your issue should be fixed in it.

Let us know your feedback.
Aspose.Cells19.7.5 For .Net2_AuthenticodeSigned.Zip (4.9 MB)
Aspose.Cells19.7.5 For .Net4.0.Zip (4.9 MB)


@Amjad_Sahi I have confirmed that fixes the files we were running into issues on, thanks!



Good to know that your issue is sorted out by the new fix/version. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.


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