API Reference
Enum
SheetNameValidationMode
Controls how worksheet names are validated when adding sheets.
Inheritance
- Enum
- SheetNameValidationMode
Inherited Methods
public override sealed Int32 CompareTo(Object target) #Returns:
Int32Inherited from Enum
Parameters
- target Object
public override sealed String ToString(String format, IFormatProvider provider) #Returns:
StringInherited from Enum
Obsolete("The provider argument is not used. Use ToString(String) instead.")Parameters
- format String
Values
public const SheetNameValidationMode None #Do not alter the provided name. The caller is responsible for ensuring it obeys Excel rules.
Value:
0public const SheetNameValidationMode 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.
Value:
1public const SheetNameValidationMode 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.
Value:
2