Click or drag to resize
NanoXLSX

WorkbookCopyWorksheetTo(String, String, Workbook, Boolean) Method

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

Namespace: NanoXLSX
Assembly: NanoXLSX (in NanoXLSX.dll) Version: 2.6.4+e304ab0274fa680d1e83f83c8f76c3bd5a54caf2
Syntax
C#
public Worksheet CopyWorksheetTo(
	string sourceWorksheetName,
	string newWorksheetName,
	Workbook targetWorkbook,
	bool sanitizeSheetName = true
)

Parameters

sourceWorksheetName  String
Name 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
Remarks
The copy is not set as current worksheet. The existing one is kept
See Also