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

Free Support Forum - aspose.com

Index Out of range -Value must beb nonnegative Exception


I am using Aspose.Cell version licensed version.

I am trying to generate excel report from datatable.
It has 2115 rows and 604 columns.

The Error is thrown in the Line 1 shown below(highlighted) while initializing Cells.

Cells cells = objFrameworkExcel.Excel.Worksheets[intTable].Cells;
cells.MemorySetting = MemorySetting.MemoryPreference; objFrameworkExcel.Excel.Worksheets[intTable].Cells.ImportDataTable(dstFormatedData.Tables[intTable], true, “A1”);

Note: objFrameworkExcel is my class object

Please let me know the solution to overcome this exception


Hi Raghu,

Thanks for your posting and using Aspose.Cells.

Your code looks good. However, we cannot test and replicate it until you provide us some sample preferably console application replicating this issue. Please provide the needful so that we test it at our end and log it in our database for a fix.

Please also check if you remove MemoryPreference setting, then does it work or not?

Let us know your feedback.