Free Support Forum - aspose.com

Aspose.Cell CalculateFormula() Index was out of range. Must be non-negative and less than the size of the collection.\r\nParameter name: index"

Hi,

I am using Aspose.Cell 7.2.2 to create worksheets(xlsx) with huge amount of basic formula's such as(VLookUp, If case etc). But while executing CalculateFormula() on WorkSheet it gives me error " Index was out of range. Must be non-negative and less than the size of the collection.\r\nParameter name: index".

Stack Trace for reference

at Aspose.Cells.Workbook.CalculateFormula(Boolean ignoreError, ICustomFunction customFunction)
at Aspose.Cells.Workbook.CalculateFormula()

Also if I try to save the workbook in Memory Stream(with out Calculating Formula) , it again gives the same error, below is the stack trace for reference.

at System.Collections.ArrayList.get_Item(Int32 index)
at Aspose.Cells.NameCollection.get_Item(Int32 index)
at —..Š(Int32 , Int32 , Byte[] , Int32 , Int32 , Boolean )
at —..Š(Cell )
at ’’.ž.Š(Cell )
at Aspose.Cells.Cell.()
at ”..(XmlTextWriter )
at ”..Write(XmlTextWriter )
at ”..‡†( )
at ”..†( )
at ”..†()
at ”..Write()
at ”..ˆ(Workbook , Stream , FileFormatType , SaveOptions )
at Aspose.Cells.Workbook.Save(Stream stream, SaveOptions saveOptions)

It seems to be an internal object overflow issue, kindly suggest.

Hi,

Thanks for your posting and using Aspose.Cells for .NET.

Please download and use the latest version:
Aspose.Cells
for .NET v7.3.3.1

and it should resolve this exception.

If your problem still occurs, then we will need your source xls/xlsx file throwing this exception and the sample code to replicate this.

We will soon look into it and help you asap.