// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java
// The path to the documents directory.
String dataDir = Utils.getSharedDataDir(CopyingRows.class) + "rows_cloumns/";

// Create a new Workbook.
Workbook excelWorkbook = new Workbook(dataDir + "book1.xls");

// Get the first worksheet in the workbook.
Worksheet wsTemplate = excelWorkbook.getWorksheets().get(0);

// Copy the second row with data, formating, images and drawing objects to the 12th row in the worksheet.
wsTemplate.getCells().copyRow(wsTemplate.getCells(), 2, 10);

// Save the excel file.
excelWorkbook.save(dataDir + "CopyingRows_out.xls");

// Print message
System.out.println("Row and Column copied successfully.");