重命名工作表
Contents
[
Hide
]
在使用Aspose.Cells.GridWeb时,重命名工作表可能会非常有用,当决定更改它们的名称以使其更加有意义时。例如,包含发票的工作表可以将其重命名为Invoice,而不是Sheet1。本主题描述了这个简单但十分有用的功能。
重命名工作表
所有工作表都包含一个Name属性,允许开发人员访问或修改工作表的名称。要重命名工作表:
- 从GridWorksheetCollection中访问工作表。
- 重命名选定的工作表。
有关如何在Aspose.Cells.GridWeb中访问工作表的更多详细信息,请参阅访问工作表。
在执行代码之前,工作表具有默认名称,如Sheet1。
输入文件:具有默认名称Sheet1的工作表
运行代码后,工作表重命名为Students。
输出:工作表已重命名为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"; |