Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

How to: Rename a Worksheet

Important

You need a license for the DevExpress Office File API Subscription or DevExpress Universal Subscription to use these examples in production code.

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

View Example

// 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.