Skip to main content
A newer version of this page is available. .

How to: Set a Worksheet Name

The example below demonstrates how to set a worksheet name. To do this, use the IXlSheet.Name property.

Tip

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=T253492.

using (IXlSheet sheet = document.CreateSheet())
{
    // Specify the worksheet name.
    sheet.Name = "Sales report";
}

When naming a worksheet, take into account the following constraints.

  • The worksheet name must be unique.
  • The worksheet name must not exceed 31 characters.
  • The worksheet name must not contain the following symbols: , /, ?, :, *, [ or ]
  • The worksheet name must not start and end with a single quote (‘).
  • The worksheet name must not be an empty string.