Skip to main content
Row

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

Worksheet.Name Property

Gets or sets the name of the worksheet .

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v24.2.Core.dll

NuGet Package: DevExpress.Spreadsheet.Core

#Declaration

string Name { get; set; }

#Property Value

Type Description
String

A String value which specifies the worksheet name.

#Remarks

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

  • A worksheet name must not be equal to a name that is already contained in the collection of existing worksheets (IWorkbook.Worksheets).
  • A worksheet name must not exceed 31 characters.
  • A worksheet name must not contain the following symbols: , /, ?, :, *, [ or ]
  • The worksheet name must not start and end with a single quote (‘).
  • A worksheet name must not be an empty string.

Worksheet Indexes

To add a new worksheet under the specified name to the workbook, use the WorksheetCollection.Add or WorksheetCollection.Insert method with the worksheet name passed as a parameter.

#Example

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";

The following code snippets (auto-collected from DevExpress Examples) contain references to the Name property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also