I have an older excel (97-2003) with 8 tabs, 2 charts on tab 1. After creating a workbook from the excel, it has both of the charts on the correct worksheet (see them when debugging). When I call Chart.Calculate on the first chart, it throws an exception:
System.ArgumentOutOfRangeException: 'Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index’
The only other clue I have is that this PlotBy value on both charts has thrown (what I can only assume is) the culprit exception:
PlotBy = ‘chart.PlotBy’ threw an exception of type ‘System.ArgumentOutOfRangeException’
I was previously using version 21.1.0 of Aspose.Cells, but upgraded to 21.2.0 (latest stable) to see if it might fix it, but the issue persists. Any idea what might be going on here?
@bheth,
You may please share your sample Excel file and a runnable console application to reproduce the issue here. We will analyze the scenario and share our feedback accordingly.
@bheth,
We have observed this issue here and logged it in our database for further investigation. You will be notified here once any update is ready for sharing.
This issue is logged as: CELLSNETCORE-107 - Chart.Calculate raises ArgumentOutOfRangeException
@bheth,
If you only load the data of the worksheets, the defined names are not loaded, so an Exception is thrown.
Please change your codes as the following :
LoadOptions options = new LoadOptions(LoadFormat.Excel97To2003)
{
LoadFilter = new LoadFilter(LoadDataFilterOptions.SheetData | LoadDataFilterOptions.DefinedNames), MemorySetting = MemorySetting.MemoryPreference
};