Kopiera arbetsblad

Aspose.Cells - Kopiera arbetsblad

C#

 //Create a new Workbook by excel file path

Workbook wb = new Workbook("../../data/workbook.xlsx");

//Create a Worksheets object with reference to the sheets of the Workbook.

WorksheetCollection sheets = wb.Worksheets;

//Copy data to a new sheet from an existing sheet within the Workbook.

sheets.AddCopy("Sheet1");

wb.Save("../../data/workbook.xlsx");

NPOI - HSSF XSSF - Kopiera arbetsblad

C#

 IWorkbook wb = new XSSFWorkbook();

wb.CreateSheet("new sheet");

wb.CreateSheet("second sheet");

ISheet cloneSheet = wb.CloneSheet(0);

FileStream sw = File.Create("newWorksheet.xls");

wb.Write(sw);

sw.Close();

Ladda ned körbar kod

Ladda ner Kopiera arbetsblad från någon av de nedan nämnda sociala kodningssidorna: