# Copy-OfficeExcelSheet

Copies a worksheet within a workbook or from another workbook.

Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

[View on GitHub](https://github.com/EvotecIT/OfficeIMO/tree/master/PowerShell/PSWriteOffice) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteOffice/releases/tag/v3.0.5) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteOffice/0.2.0)

Stars **727**

Forks **84**

Open issues **7**

Total downloads **5,275,783**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-24

Cmdlet 

Aliases: ExcelSheetCopy

**Module**

`PSWriteOffice`

**Aliases**

`ExcelSheetCopy`

**Inputs**

`OfficeIMO.Excel.ExcelDocument`

**Outputs**

`OfficeIMO.Excel.ExcelSheet`

**Source**

[CopyOfficeExcelSheetCommand.cs:30](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Excel/CopyOfficeExcelSheetCommand.cs#L30) 

Copies a worksheet within a workbook or from another workbook.

## Syntax

```
Copy-OfficeExcelSheet
[-CopyMode <Values|Package>]
[-NewName] <String>
[-PassThru]
[-SourceDocument <ExcelDocument>]
[-SourcePath <String>]
[[-SourceSheet] <String>]
[-ValidationMode <Sanitize|Strict>]
[<CommonParameters>]
```

[#](#method-copy-officeexcelsheet-excelworksheetcopymode-string-switchparameter-exceldocument-string-string-excelsheetnamevalidationmode)

Parameter set: `Context`

```
Copy-OfficeExcelSheet
[-CopyMode <Values|Package>]
[-NewName] <String>
[-PassThru]
[-Path] <String>
[-SourceDocument <ExcelDocument>]
[-SourcePath <String>]
[[-SourceSheet] <String>]
[-ValidationMode <Sanitize|Strict>]
[<CommonParameters>]
```

[#](#method-copy-officeexcelsheet-excelworksheetcopymode-string-switchparameter-string-exceldocument-string-string-excelsheetnamevalidationmode)

Parameter set: `Path`

```
Copy-OfficeExcelSheet
[-CopyMode <Values|Package>]
-Document <ExcelDocument>
[-NewName] <String>
[-PassThru]
[-SourceDocument <ExcelDocument>]
[-SourcePath <String>]
[[-SourceSheet] <String>]
[-ValidationMode <Sanitize|Strict>]
[<CommonParameters>]
```

[#](#method-copy-officeexcelsheet-excelworksheetcopymode-exceldocument-string-switchparameter-exceldocument-string-string-excelsheetnamevalidationmode)

Parameter set: `Document`

## Examples

### Copy a worksheet and confirm it exists.

```powershell
$proof = @(
    Copy-OfficeExcelSheet -Path .\Report.xlsx -SourceSheet Data -NewName DataCopy
    Get-OfficeExcelSummary -Path .\Report.xlsx -IncludeSheets |
        Select-Object -ExpandProperty Sheets |
        Where-Object Name -eq 'DataCopy'
)
$proof
```

Creates a copy of the Data worksheet and reads the workbook summary to verify the new tab.

### Copy a worksheet from another workbook using the package fast path.

```powershell
Copy-OfficeExcelSheet -Path .\Combined.xlsx -SourcePath .\Incoming.xlsx -SourceSheet RawData -NewName IncomingRaw -CopyMode Package
Get-OfficeExcelUsedRange -Path .\Combined.xlsx -Sheet IncomingRaw
```

Copies the source worksheet package directly so large workbook merges avoid converting rows into PowerShell objects. Use CopyMode Values only when you explicitly want the reader/writer fallback.

## Parameters

**-CopyMode ExcelWorksheetCopyMode optional**

Controls whether cross-workbook copies use package-level copy or value materialization.

Possible values: `Values`, `Package`

**-NewName String requiredposition: 2aliases: DestinationSheet, Name**

Name for the copied worksheet.

**-PassThru SwitchParameter optional**

Emit the object created or changed by the command.

**-SourceDocument ExcelDocument optional**

Optional source workbook object for cross-workbook copies.

**-SourcePath String optional**

Optional source workbook path for cross-workbook copies.

**-SourceSheet String optionalposition: 1aliases: Sheet, WorksheetName**

Worksheet to copy. Defaults to the current sheet inside an ExcelSheet block.

**-ValidationMode ExcelSheetNameValidationMode optional**

Controls how invalid destination sheet names are handled.

Possible values: `Sanitize`, `Strict`

**-Path String requiredposition: 0aliases: FilePath, InputPathsets: Path**

Target workbook path to update.

**-Document ExcelDocument requiredpipeline: True (ByValue)sets: Document**

Target workbook to update outside the DSL context.

## Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see [about_CommonParameters](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:7202D6E6A1F58D0C3D84C65497BB98168581F7692EEF5DBE492D2CD281E09CD1 -->
