Table of Contents

Property Name

Namespace
DocWright.Spreadsheet
Assembly
DocWright.Spreadsheet.dll

Name

Gets or sets the sheet's name, as its tab shows it.

public string Name { get; set; }

Property Value

string

1 to 31 characters, none of : \ / ? * [ ], no apostrophe at either end, and not the name of another sheet (names compare without regard to case).

Remarks

Setting it renames the sheet, and everything that refers to the sheet by name follows as it does in Excel: formulas on every sheet, defined names, chart series, conditional formats, validations, the source of a pivot table. A name that needs apostrophes is written with them ('My Data'!B4). A hyperlink's target is left as it was, which is what Excel does too.

Nothing is calculated and nothing needs to be: a formula computes what it computed.

Exceptions

ArgumentNullException

The value is null.

ArgumentException

The value is not a legal sheet name, holds a character a workbook cannot store, or another sheet has it.

InvalidOperationException

The sheet was deleted.

InvalidDocumentException

A part of the workbook is malformed.