//--- Open the workbook and worksheet from which we will copy cells.
Workbook sourceWb = xla.Open("MyDataSource.xls");
Worksheet sourceWs = sourceWb[0];
//--- Create the workbook and and get the worksheet
//--- into which we will paste cells.
Workbbok destWb = xla.Create("MyNewWorkbook");
Worksheet destWs = destWb[0];
//--- Define the area of cells to copy.
Area srcArea = sourceWs.CreateArea("A1:F20");
//--- Paste the data onto the destination worksheet.
//--- Copy all supported data types (excluding row height and column width).
destWs.CopyPaste("A1", srcArea);
|