删除工作表
Contents
[
Hide
]
本主题讨论了使用Aspose.Cells.GridDesktop控件删除工作表。有几种简单的方法来完成这个基本任务。
删除工作表
要使用Aspose.Cells.GridDesktop控件删除工作表,请按照以下步骤:
- 在表单中添加 Aspose.Cells.GridDesktop 控件。
- 在 GridDesktop 控件中调用 Worksheets 集合的 Remove 方法。
使用工作表索引
使用这种方法,只需将要删除的工作表的索引(在网格的工作表集合中)传递给它。
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 | |
// Removing a worksheet using its index | |
gridDesktop1.Worksheets.Remove(0); |
使用工作表名称
如果知道工作表的名称,则可以通过指定其名称来删除特定的工作表。
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 | |
// Removing a worksheet using its index | |
gridDesktop1.Worksheets.RemoveAt("Sheet3"); |
Remove 是一个方法。 使用它来删除工作表(使用工作表集合中的索引),或使用 RemoveAt 方法来删除工作表(使用索引/名称)。