Copies the worksheet to another location in the workbook.
Assembly: Microsoft.Office.Tools.Excel.v4.0.Utilities (in Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)
The new worksheet is a Microsoft.Office.Interop.Excel.Worksheet object and does not have the code or data binding capability that worksheet host items have.
If you do not specify either Before or After, Microsoft Office Excel creates a new workbook that contains the copied sheet.
For information on optional parameters, see Optional Parameters in Office Solutions.
The following code example uses the method to create copies of the current worksheet before Sheet1 and after Sheet3. The example uses the InnerObject property to access the underlying Microsoft.Office.Interop.Excel.Worksheet for Sheet1 and Sheet3.
This example is for a document-level customization.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.