In Excel, rows and columns are actually still range, but the way to get rows and columns is somewhat different from the previous essays, to use the Get_item method of the rows and columns properties of worksheet, the following is an example code that shows how to select rows. and copy the data between the rows, and insert the row:
ThisApplication = new Excel.Application ();
ThisWorkbook = ThisApplication.Workbooks.Open ("Z:\\book1.xls", Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
Thisapplication.displayalerts = false;
Xlsheet = (Excel.Worksheet) ThisWorkbook.Worksheets.get_Item (1);
Excel.Range Range = Xlsheet.get_range ("G4", Type.Missing);
Excel.Range Range = (excel.range) xlSheet.Rows.get_Item (%, type.missing);
Excel.Range Range1 = (excel.range) xlSheet.Rows.get_Item (type.missing);
Range. Value = "123";
Range. Copy (range1);
Range1. Rows.insert (Xlinsertshiftdirection.xlshiftdown);
Thisworkbook.saveas ("Z:\\book2.xls", Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Excel.XlSaveAsAccessMode.xlNoChange,
Type.Missing, Type.Missing, Type.Missing, Type.Missing);
About the release of the Excel process, the previous essays have been, here will not repeat.