# Add-OfficeExcelTableRow

Appends one or more data rows to an existing Excel table.

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 **725**

Forks **84**

Open issues **3**

Total downloads **5,231,343**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-23

Cmdlet 

**Module**

`PSWriteOffice`

**Inputs**

`OfficeIMO.Excel.ExcelDocument` `OfficeIMO.Excel.ExcelTable` `System.Object`

**Outputs**

`OfficeIMO.Excel.ExcelTable`

**Source**

[AddOfficeExcelTableRowCommand.cs:44](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Excel/AddOfficeExcelTableRowCommand.cs#L44) 

Appends one or more data rows to an existing Excel table.

## Syntax

```
Add-OfficeExcelTableRow
[-InputObject] <Object>
[-PassThru]
[-Path] <String>
[-Sheet <String>]
[-SheetIndex <Int32>]
-TableName <String>
[<CommonParameters>]
```

[#](#method-add-officeexceltablerow-object-switchparameter-string-string-int32-string)

Parameter set: `Path`

```
Add-OfficeExcelTableRow
-Document <ExcelDocument>
[-InputObject] <Object>
[-PassThru]
[-Sheet <String>]
[-SheetIndex <Int32>]
-TableName <String>
[<CommonParameters>]
```

[#](#method-add-officeexceltablerow-exceldocument-object-switchparameter-string-int32-string)

Parameter set: `Document`

```
Add-OfficeExcelTableRow
[-InputObject] <Object>
[-PassThru]
-Table <ExcelTable>
[<CommonParameters>]
```

[#](#method-add-officeexceltablerow-object-switchparameter-exceltable)

Parameter set: `Table`

## Description

Use this command when a workbook already contains a named table and the script should extend that table without recreating the worksheet through the Excel DSL. The command accepts a workbook path, an open ExcelDocument, or an existing ExcelTable object. Objects, dictionaries, DataTable, DataView, IDataReader, and DataRow input are normalized through the same table input pipeline used by Add-OfficeExcelTable.

When a path is supplied, PSWriteOffice opens the workbook, appends the rows, saves the workbook, and releases the document. When an open workbook or table is supplied, the caller controls the lifetime and should close or save the workbook after all edits are complete.

## Examples

### Append a row to a named table in an open workbook.

```powershell
$doc = Get-OfficeExcel -Path .\Report.xlsx
$doc | Add-OfficeExcelTableRow -Sheet Data -TableName Sales -InputObject ([pscustomobject]@{ Region='APAC'; Revenue=300 })
$doc | Close-OfficeExcel -Save
```

Uses the existing OfficeIMO Excel table append API and keeps the workbook open for further changes.

### Append several service-readiness rows to an existing table.

```powershell
$rows = @(
    [pscustomobject]@{ Service='Identity'; Status='Ready'; Owner='IAM' }
    [pscustomobject]@{ Service='Network'; Status='Investigating'; Owner='Platform' }
)
Add-OfficeExcelTableRow -Path .\Readiness.xlsx -Sheet Readiness -TableName ServiceReadiness -InputObject $rows
```

Opens the workbook from disk, appends both objects to the named table, and saves the file.

## Parameters

**-InputObject Object requiredposition: 1pipeline: True (ByValue)aliases: Data, Values**

Rows to append. Accepts objects, dictionaries, DataTables, DataViews, IDataReaders, and DataRows.

**-PassThru SwitchParameter optional**

Emit the updated table wrapper for open document or table inputs. Path-owned workbooks are saved and closed by this command, so they do not emit a live table wrapper.

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

Workbook path to open, update, save, and close.

**-Sheet String optionalaliases: WorksheetNamesets: Path, Document**

Worksheet name that owns the table. Use this when table names might repeat across sheets.

**-SheetIndex Int32 optionalsets: Path, Document**

Zero-based worksheet index that owns the table.

**-TableName String requiredaliases: Namesets: Path, Document**

Existing table name or display name, for example the name returned by Get-OfficeExcelTable.

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

Open workbook to update. The caller remains responsible for saving and closing it.

**-Table ExcelTable requiredpipeline: True (ByValue)sets: Table**

Existing OfficeIMO Excel table wrapper to append to when the table has already been resolved.

## 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:3FF5A2E7D1552A1D2EA8218C3BBA9DE670BFB5C070FEF9D0D8C2192E5D49AEC7 -->
