// Source directory path. U16String srcDir("SourceDirectory\\Excel\\"); // Output directory path. U16String outDir("OutputDirectory\\"); // Load the input Excel file Workbook workbook(srcDir + u"Sample1.xlsx"); // Get the first worksheet Worksheet worksheet = workbook.GetWorksheets().Get(0); // Copy Row worksheet.GetCells().CopyRows(worksheet.GetCells(), 1, 15, 3); // Save the Excel file workbook.Save(outDir + u"CopyRows_out.xlsx");