Aspose.Cells.Examples.CSharp.RowsColumns.Copying.CopyingRows.Run C# (CSharp) Method

Run() public static method

public static Run ( ) : void
return void
        public static void Run()
        {
            // ExStart:1
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

            // Open the existing excel file.
            Workbook excelWorkbook1 = new Workbook(dataDir + "book1.xls");

            // Get the first worksheet in the workbook.
            Worksheet wsTemplate = excelWorkbook1.Worksheets[0];

            // Copy the second row with data, formattings, images and drawing objects
            // To the 16th row in the worksheet.
            wsTemplate.Cells.CopyRow(wsTemplate.Cells, 1, 15);

            // Save the excel file.
            excelWorkbook1.Save(dataDir + "output.xls");
            // ExEnd:1

        }
    }
CopyingRows