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

How to: Rename a Worksheet

Important

The Universal Subscription or an additional Document Server Subscription is required to use this example in production code. Please refer to the DevExpress Subscription page for pricing information.

This example demonstrates how to rename a worksheet. To do this, use the Worksheet.Name property of the corresponding Worksheet object.

// Change the name of the second worksheet.
workbook.Worksheets[1].Name = "Renamed Sheet";

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

  • The worksheet name must not be equal to an existing name in the collection of worksheets (Workbook.Worksheets).
  • 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.