We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to add row to the end of a worksheet

Thread ID:





72894 Apr 10,2008 11:05 AM UTC Apr 18,2008 12:03 PM UTC WinForms 3
Tags: XlsIO
Brian Richards
Asked On April 10, 2008 11:05 AM UTC

I'm trying to figure out how to add a row to the end of a worksheet. InsertRow will only add a before the last row in the worksheet. And using InsertRow with a value greater than IWorksheet.Rows.Length is ignored.

Bhuvaneswari P [Syncfusion]
Replied On April 11, 2008 04:25 AM UTC

Hi Brian,

Thanks for the update.

If your intention to insert row after the end of the used range, then please use mySheet.UsedRange.End.Row. Please use the below code snippet to insert row after used range row:
MessageBox.Show("Before insert :total rows Edited:" + mySheet.UsedRange.End.Row.ToString());
//To insert the row after specified some row index
mySheet.InsertRow(mySheet.UsedRange.End.Row,1, ExcelInsertOptions.FormatDefault );
MessageBox.Show("After insert: total rows:" + mySheet.UsedRange.End.Row.ToString());

Here is the sample for your reference:


or If your intention is to insert the row at the end of the worksheet, then this is not possible to get the end of the row in the worksheet using our XlsIO API's.

Please let me know if I am missing anything.

Best Regards,

Brian Richards
Replied On April 11, 2008 12:59 PM UTC

My needs are to do exactly what you say that I can't do.

Bhuvaneswari P [Syncfusion]
Replied On April 18, 2008 12:03 PM UTC

Hi Brian,

As we said in the last update, it is not possible to add row to the end of a worksheet.

Please let me know if you have any other questions.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon