How to delete Row[i]?


#1

I want to delete a row which I choosed according my arithmetic, I used the command: excel.Worksheets[“Sheet1”].Cells.Rows.RemoveAt(3);
but it did not work, I wonder is there any effective method to do this?
Thank you!


#2

I also used: excel.Worksheets[“Sheet1”].Cells.DeleteRow(3);
it still did not work!


#3

Please use

excel.Worksheets[“Sheet1”].Cells.DeleteRow(3);

It deletes row at 4. Row index parameter in DeleteRow method is zero based.


#4

it didnot change anything!
My codeline is:
Excel excel=new Excel();
excel.Open(“E:\xue.xls”);
excel.Worksheets[“Sheet1”].Cells.DeleteRow(0);


#5

Could you email me your file?