PicoXLSX Library Documentation
![]() | WorkbookAddWorksheet Method (String, Boolean) |
Adding a new Worksheet with a sanitizing option. The new worksheet will be defined as current worksheet
Namespace: PicoXLSX
Assembly: PicoXLSX (in PicoXLSX.dll) Version: 2.4.0.0 (2.4.0)

C#
public void AddWorksheet( string name, bool sanitizeSheetName )
Parameters
- name
- Type: SystemString
Name of the new worksheet - sanitizeSheetName
- Type: SystemBoolean
If true, the name of the worksheet will be sanitized automatically according to the specifications of Excel

Exception | Condition |
---|---|
WorksheetException | WorksheetException is thrown if the name of the worksheet already exists and sanitizeSheetName is false |
FormatException | FormatException is thrown if the worksheet name contains illegal characters or is out of range (length between 1 an 31) and sanitizeSheetName is false |
