Click or drag to resize
NanoXLSX

WorkbookCopyWorksheetTo(Worksheet, String, Workbook, Boolean) Method

Copies a worksheet of any workbook into the another workbook

Namespace: NanoXLSX
Assembly: NanoXLSX (in NanoXLSX.dll) Version: 2.6.7+b0ed5f8a99a50b9e6528224889fbd7f23c30b364
Syntax
C#
public static Worksheet CopyWorksheetTo(
	Worksheet sourceWorksheet,
	string newWorksheetName,
	Workbook targetWorkbook,
	bool sanitizeSheetName = true
)

Parameters

sourceWorksheet  Worksheet
Worksheet to copy
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
Remarks
The copy is not set as current worksheet. The existing one is kept
See Also