Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Enum

ExcelSheetNameValidationMode

OfficeIMO.Excel

Namespace
OfficeIMO.Excel
Assembly
OfficeIMO.Excel
Source revision
0eef6a5756b9 with working tree changes
Base
Enum
Implements
IComparable ISpanFormattable IFormattable IConvertible
Modifiers
sealed

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.

Accepted by parameters 3

Values

public const ExcelSheetNameValidationMode None #

Do not alter the provided name. The caller is responsible for ensuring it obeys Excel rules.

Value: 0
public 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.

Value: 1
public 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.

Value: 2