Click or drag to resize
NanoXLSX

WorkbookCopyWorksheetIntoThis(Worksheet, String, Boolean) Method

Copies a worksheet of any workbook into the current workbook

Namespace: NanoXLSX
Assembly: NanoXLSX (in NanoXLSX.dll) Version: 2.6.5+4f4b44a718a20dda8ca2c0c4d00bd7eee7c80f5d
Syntax
C#
public Worksheet CopyWorksheetIntoThis(
	Worksheet sourceWorksheet,
	string newWorksheetName,
	bool sanitizeSheetName = true
)

Parameters

sourceWorksheet  Worksheet
Worksheet to copy
newWorksheetName  String
Name of the new worksheet (copy)
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. The source worksheet can originate from any workbook
See Also