复制工作表

复制工作表

使用Sheet索引

下面的示例代码显示了如何通过指定工作表在GridWorksheetCollection的AddCopy方法中的索引,将工作表的副本添加到GridWeb控件。

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// Adding the copy of a worksheet to GridWeb by specifying its sheet index
int sheetIndex = GridWeb1.WorkSheets.AddCopy(0);

使用工作表名称

下面的示例代码显示了如何通过指定工作表在GridWorksheetCollection的AddCopy方法中的名称,将工作表的副本添加到GridWeb控件。

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// Adding the copy of a worksheet to GridWeb by specifying its sheet name
int sheetIndex1 = GridWeb1.WorkSheets.AddCopy("Students");