ワークシートをコピーする

ワークシートのコピー

シート インデックスの使用

以下のコード例は、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");