API Reference
Command
Add-OfficeExcelTable
Writes tabular data to the current worksheet and formats it as an Excel table.
Remarks
Writes tabular data to the current worksheet and formats it as an Excel table.
Examples
Insert a table starting at A1.
PS>$data = @([pscustomobject]@{ Region='NA'; Revenue=100 }, [pscustomobject]@{ Region='EMEA'; Revenue=150 })
ExcelSheet 'Data' { Add-OfficeExcelTable -Data $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] -Data <Object[]> [-NoAutoFilter] [-NoHeader] [-PassThru] [-StartColumn <Int32>] [-StartRow <Int32>] [-TableName <String>] [-TableStyle <String>] [<CommonParameters>]#Parameter set:
All Parameter SetsParameters
- AutoFit SwitchParameter
- Auto-fit the table columns after insertion.
- Data Object[]
- Source objects to convert into table rows.
- NoAutoFilter SwitchParameter
- Disable AutoFilter dropdowns.
- NoHeader SwitchParameter
- Skip writing headers.
- PassThru SwitchParameter
- Return the created range string.
- 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.
Outputs
System.Object