API Reference
Cmdlet
Add-OfficeExcelTable
Writes tabular data to the current worksheet and formats it as an Excel table.
Remarks
Accepts objects, dictionaries, DataTable/DataView/IDataReader inputs, or DataRow sequences and writes them into an Excel table with optional styling.
Examples
Example 1: Insert a table starting at A1.
PS>
$data = @([pscustomobject]@{ Region='NA'; Revenue=100 }, [pscustomobject]@{ Region='EMEA'; Revenue=150 })
ExcelSheet 'Data' { Add-OfficeExcelTable -InputObject $data -TableName 'Sales' }
Writes two rows and formats them as a styled Excel table.
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.
Syntax
Add-OfficeExcelTable [-AutoFit] -InputObject <Object> [-NoAutoFilter] [-NoHeader] [-NoRowStripes] [-PassThru] [-ShowColumnStripes] [-ShowFirstColumn] [-ShowLastColumn] [-StartColumn <Int32>] [-StartRow <Int32>] [-TableName <String>] [-TableStyle <String>] [-View <Normal|Transpose>] [<CommonParameters>]#Parameter set:
All Parameter SetsParameters
- AutoFit SwitchParameter
- Auto-fit the table columns after insertion.
- InputObject Object
- Source objects, dictionaries, DataTable/DataView/IDataReader inputs, or DataRow sequences to convert into table rows.
- NoAutoFilter SwitchParameter
- Disable AutoFilter dropdowns.
- NoHeader SwitchParameter
- Skip writing headers.
- NoRowStripes SwitchParameter
- Disable alternating row stripes for the created table.
- PassThru SwitchParameter
- Return the created range string.
- ShowColumnStripes SwitchParameter
- Enable alternating column stripes for the created table.
- ShowFirstColumn SwitchParameter
- Emphasize the first table column when the selected style supports it.
- ShowLastColumn SwitchParameter
- Emphasize the last table column when the selected style supports it.
- StartColumn Int32
- Starting column for the data (1-based).
- StartRow Int32
- Starting row for the data (1-based).
- TableName String
- Name to assign to the table.
- TableStyle String
- Built-in table style to apply.
- View OfficeTableView
- Projection to apply before writing the table. Possible values: Normal, Transpose
- Possible values:
Normal,Transpose