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.
Unfortunately, activation email could not send to your email. Please try again.

How to add row to the end of a worksheet

Thread ID:

Created:

Updated:

Platform:

Replies:

72894 Apr 10,2008 07:05 AM Apr 18,2008 08:03 AM Windows Forms 3
loading
Tags: XlsIO
Brian Richards
Asked On April 10, 2008 07:05 AM

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 12:25 AM

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:
[C#]
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:


http://websamples.syncfusion.com/samples/XlsIO.Windows/I42808_2/main.htm


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,
Bhuvana



Brian Richards
Replied On April 11, 2008 08:59 AM

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


Bhuvaneswari P [Syncfusion]
Replied On April 18, 2008 08:03 AM

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.

Regards,
Bhuvana


CONFIRMATION

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.

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.

;