Rename Worksheets
Contents
[
Hide
]
Renaming a worksheet can be very useful when working with many worksheets in Aspose.Cells.GridWeb and decide to change their names to make them more meaningful. For example, a worksheet containing an invoice can be renamed Invoice instead of Sheet1. This topic describes this simple but useful feature.
Renaming a Worksheet
All worksheets contain a Name property that allows developers to access or modify worksheets' names. To rename a worksheet:
- Access a worksheet from the GridWorksheetCollection.
- Rename the selected worksheet.
For more details on how to access worksheets in Aspose.Cells.GridWeb, please refer to Access Worksheets.
Before executing the code, the worksheet has a default name, such as Sheet1.
Input file: a worksheet with a default name Sheet1
After running the code, the worksheet is renamed Students.
Output: the worksheet is renamed Students
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// Renaming a worksheet | |
GridWeb1.WorkSheets[0].Name = "Students"; |