Click or drag to resize
PicoXLSX

WorkbookCopyWorksheetTo(Int32, String, Workbook, Boolean) Method

Copies a worksheet of the current workbook by its index into another workbook

Namespace: PicoXLSX
Assembly: PicoXLSX (in PicoXLSX.dll) Version: 3.4.3+c820fb107cc06ae187946bad43db42d71f6faf1c
Syntax
C#
public Worksheet CopyWorksheetTo(
	int sourceWorksheetIndex,
	string newWorksheetName,
	Workbook targetWorkbook,
	bool sanitizeSheetName = true
)

Parameters

sourceWorksheetIndex  Int32
Index of the worksheet to copy, originated in this workbook.
newWorksheetName  String
Name of the new worksheet (copy).
targetWorkbook  Workbook
Workbook to copy the worksheet into.
sanitizeSheetName  Boolean  (Optional)
If true, the new name will be automatically sanitized if a name collision occurs.

Return Value

Worksheet
Copied worksheet.
See Also