GemBox.Spreadsheet

ExcelWorksheetCollection.AddCopy Method 

Adds a copy of an existing worksheet to the end of the collection.

public ExcelWorksheet AddCopy(
   string destinationWorksheetName,
   ExcelWorksheet sourceWorksheet
);

Parameters

destinationWorksheetName
Name of new worksheet.
sourceWorksheet
Source worksheet.

Return Value

Newly created worksheet.

Remarks

If this is the first worksheet added to the collection the ActiveWorksheet is set to this worksheet.

Exceptions

Exception Type Condition
ArgumentException Thrown if worksheet name is not unique.

See Also

ExcelWorksheetCollection Class | GemBox.Spreadsheet Namespace