Copier la feuille de calcul

Aspose.Cells - Copier la feuille de calcul

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 - Copier la feuille de calcul

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();

Télécharger le code en cours d’exécution

Télécharger le formulaire Copier la feuille de calcul à partir de l’un des sites de codage social mentionnés ci-dessous :