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

Free Support Forum - aspose.com

NullReferenceException while inserting rows

Ok, So we are doing something that cannot be made simpler.


We are inserting rows in an excel file. This is a .xlsx file containing some sensitive information. We need to insert rows. So we use the following API:

wsheet.Cells.InsertRows(12, tblEntityList.Rows.Count, True)

This cannot be more simpler. And yet we get the following exception:
"Object reference not set to an instance of an object."

Here is the stacktrace:

at Aspose.Cells.ConditionalFormattings.xc62b07e82af56ce0(Int32 x78a7603cacf2ae22, Int32 xa21e294c3adee41c)
at Aspose.Cells.Cells.InsertRows(Int32 rowIndex, Int32 rowNumber)
at Aspose.Cells.Cells.InsertRows(Int32 rowIndex, Int32 rowNumber, Boolean updateReference)
at PS.xxxx.Web.FederalK1Report.GeneralFederalK1Data(Int32 entityID, String legalName, Object& wbook) in :\Projects\TFSBS09xxxxxxx:line 39

We are using version 4.8.1.0 of Aspose.

Please do not ask us to check object references because we have double checked and they are all valid objects. Not null.

What is happening??

Hi,

Kindly try the latest version/fix v4.8.2.6.

If you still find the issue, I am afraid, we need your template file (you may use some dummy data if you want), so you may post us here. We will check your issue soon.

Thank you.

Thanks , but could not really test currently as my licence is good for updates till last month only.


thanks,
r

Hi,

In that case, I think you may try some recent versions/fixes if the latest fix is not applicable for your license. For example, you may try official release v4.8.2.0: http://www.aspose.com/community/files/51/.net-components/aspose.cells-for-.net/entry215207.aspx
This version is released on Dec 31, 2009.

Thank you.