ExcelSheetNameValidationMode
OfficeIMO.Excel
Controls how worksheet names are validated when adding sheets.
Inheritance
- Enum
- ExcelSheetNameValidationMode
Usage
Explore 7 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 4
Accepted by parameters 3
- Method ExcelDocument.AddSheet
- Method ExcelDocument.CopyWorksheet
- Method ExcelDocument.CopyWorksheetFrom
Inherited Methods
public string ToString(IFormatProvider? provider) #Obsolete("The provider argument is not used. Use ToString() instead.")Parameters
- provider IFormatProvider?
Returns
stringpublic string ToString(string? format, IFormatProvider? provider) #Obsolete("The provider argument is not used. Use ToString(String) instead.")Parameters
- format string?
- provider IFormatProvider?
Returns
stringValues
public const ExcelSheetNameValidationMode None #Do not alter the provided name. The caller is responsible for ensuring it obeys Excel rules.
0public const ExcelSheetNameValidationMode Sanitize #Coerce the provided name into a valid Excel worksheet name by applying the rules: - Replace invalid characters (: \ / ? * [ ]) with underscore. - Trim leading/trailing apostrophes and whitespace. - Truncate to 31 characters. - Ensure non-empty; fall back to "Sheet". - Ensure uniqueness across the workbook by appending " (2)", " (3)", etc.
1public const ExcelSheetNameValidationMode Strict #Enforce Excel rules strictly; throw if the name is empty, too long (> 31), contains invalid characters (: \ / ? * [ ]), or would collide (case-insensitive) with an existing sheet.
2