Skip to main content

Worksheet.CodeName Property

Gets or sets the worksheet’s code name.

Namespace: DevExpress.Spreadsheet

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

NuGet Package: DevExpress.Spreadsheet.Core


string CodeName { get; set; }

Property Value

Type Description

The code name.


Use the CodeName property to specify an internal worksheet name that does not change when a user renames the worksheet.

The following method returns a worksheet with the specified code name:

using DevExpress.Spreadsheet;
using System.Linq;
// ...

private Worksheet GetSheetByCodeName(IWorkbook workbook, string codeName) {
    return workbook.Worksheets.SingleOrDefault(x => x.CodeName == codeName);

You can also use the WorksheetCollection.Item property to access a worksheet by its index or name. See the following help topic for details: How to: Access a Worksheet.

See Also