API Reference
Cmdlet
Export-OfficeExcel
Exports PowerShell objects to an Excel workbook using an operator-friendly surface.
Remarks
Provides a fast PowerShell export path while keeping OfficeIMO as the workbook engine.
Examples
Export objects to a table.
PS>
$rows | Export-OfficeExcel -Path .\Report.xlsx -WorksheetName Data -TableName Data -AutoFit -FreezeTopRow
Creates a workbook, writes the objects as a table, auto-fits columns, and freezes the header row.
Export objects with report-friendly column formats.
PS>
$rows | Export-OfficeExcel -Path .\Report.xlsx -WorksheetName Data -TableName Sales -TextColumn Id -CurrencyColumn Revenue -ColumnFormat @{ Rate = @{ Style = 'Percent'; Decimals = 1 }; Created = 'Date' } -FormatCultureName en-US -AutoFitFormattedColumn
Formats ID values as text, Revenue as currency, Rate as a one-decimal percentage, and Created as a short date while keeping formatting logic in OfficeIMO.
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
Export-OfficeExcel [-ApplicationName <String>] [-Author <String>] [-AutoFit] [-AutoFitFormattedColumn] [-BoldTopRow] [-Category <String>] [-ClearCachedFormulaResults] [-ColumnFormat <Hashtable>] [-Company <String>] [-CurrencyColumn <String[]>] [-DateColumn <String[]>] [-DateSystem <1900|1904|NineteenHundred|NineteenFour>] [-DateTimeColumn <String[]>] [-Description <String>] [-DisableFastPackageWriter] [-DocumentTitle <String>] [-EvaluateFormulas] [-ExcludeProperty <String[]>] [-ForceFullCalculationOnOpen] [-FormatCultureName <String>] [-FormatDecimals <Int32>] [-FreezeFirstColumn] [-FreezeTopRow] [-IgnoreMissingColumnFormat] [-IncludeHeaderInColumnFormat] [-IncludeUnexportableProperties] [-InputObject <Object>] [-IntegerColumn <String[]>] [-Keywords <String>] [-LastModifiedBy <String>] [-Manager <String>] [-MarkFormulasDirty] [-NoAutoFilter] [-NoClobber] [-NoHeader] [-NoRowStripes] [-NoTable] [-NumberColumn <String[]>] [-Open] [-PassThru] -Path <String> [-PercentColumn <String[]>] [-PropertyConversionErrorAction <SilentlyContinue>] [-SafePreflight] [-SafeRepairDefinedNames] [-ShowColumnStripes] [-ShowFirstColumn] [-ShowLastColumn] [-StartColumn <Int32>] [-StartRow <Int32>] [-Subject <String>] [-TableName <String>] [-TableStyle <String>] [-TextColumn <String[]>] [-Title <String>] [-ValidateOpenXml] [-WorksheetName <String>] [<CommonParameters>]#Parameter set:
CreateParameters
- ApplicationName String
- Workbook application-name metadata.
- Author String
- Workbook author metadata.
- AutoFit SwitchParameter
- Auto-fit exported columns.
- AutoFitFormattedColumn SwitchParameter
- Auto-fit only columns that receive export-time column formats.
- BoldTopRow SwitchParameter
- Bold the exported header row.
- Category String
- Workbook category metadata.
- ClearCachedFormulaResults SwitchParameter
- Remove cached formula results before saving.
- ColumnFormat Hashtable
- Header-to-format map. Values may be preset names such as Text, Currency, Percent, Date, or custom Excel number formats.
- Company String
- Workbook company metadata.
- CurrencyColumn String[]
- Headers that should be formatted as currency.
- DateColumn String[]
- Headers that should be formatted as dates.
- DateSystem String
- Workbook date system for Excel date serials.
- Possible values:
1900,1904,NineteenHundred,NineteenFour - DateTimeColumn String[]
- Headers that should be formatted as date/time values.
- Description String
- Workbook description metadata.
- DisableFastPackageWriter SwitchParameter
- Disable OfficeIMO fast package writers for this save.
- DocumentTitle String
- Workbook document title metadata.
- EvaluateFormulas SwitchParameter
- Evaluate supported formulas and write cached values before saving.
- ExcludeProperty String[]
- Exclude specific properties from exported objects.
- ForceFullCalculationOnOpen SwitchParameter
- Request a full workbook recalculation when opened in Excel-compatible applications.
- FormatCultureName String
- Culture used by friendly currency column presets, such as en-US or pl-PL.
- FormatDecimals Int32
- Decimal places used by friendly number, percent, and currency column presets.
- FreezeFirstColumn SwitchParameter
- Freeze the first exported column.
- FreezeTopRow SwitchParameter
- Freeze the exported header row.
- IgnoreMissingColumnFormat SwitchParameter
- Continue when a requested export-time column format header is missing.
- IncludeHeaderInColumnFormat SwitchParameter
- Include header cells when applying export-time column formats.
- IncludeUnexportableProperties SwitchParameter
- Include properties that cannot be read by exporting a descriptive placeholder value.
- InputObject Object
- Objects to write. Accepts pipeline input.
- IntegerColumn String[]
- Headers that should be formatted as whole numbers.
- Keywords String
- Workbook keyword metadata.
- LastModifiedBy String
- Workbook last-modified-by metadata.
- Manager String
- Workbook manager metadata.
- MarkFormulasDirty SwitchParameter
- Mark formula cells dirty before saving.
- NoAutoFilter SwitchParameter
- Disable AutoFilter dropdowns on the created table.
- NoClobber SwitchParameter
- Do not overwrite an existing workbook unless appending or clearing a sheet.
- NoHeader SwitchParameter
- Do not emit a header row.
- NoRowStripes SwitchParameter
- Disable alternating row stripes for newly created tables.
- NoTable SwitchParameter
- Do not create an Excel table around the exported data.
- NumberColumn String[]
- Headers that should be formatted as decimal numbers.
- Open SwitchParameter
- Open the workbook after saving.
- PassThru SwitchParameter
- Emit the saved FileInfo.
- Path String
- Destination workbook path.
- PercentColumn String[]
- Headers that should be formatted as percentages.
- PropertyConversionErrorAction ActionPreference
- Controls how unreadable PowerShell properties are handled while projecting export rows.
- Possible values:
SilentlyContinue,Stop,Continue,Inquire,Ignore,Suspend,Break - SafePreflight SwitchParameter
- Run OfficeIMO worksheet preflight cleanup before saving.
- SafeRepairDefinedNames SwitchParameter
- Repair common defined-name issues before saving.
- ShowColumnStripes SwitchParameter
- Enable alternating column stripes for newly created tables.
- 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 new exports.
- StartRow Int32
- Starting row for new exports. When appending and left at 1, rows are written after the used range.
- Subject String
- Workbook subject metadata.
- TableName String
- Optional Excel table name.
- TableStyle String
- Built-in Excel table style name.
- TextColumn String[]
- Headers that should be formatted as text, useful for IDs, zip codes, and leading-zero values.
- Title String
- Write a title above the exported table.
- ValidateOpenXml SwitchParameter
- Validate the saved package with OpenXmlValidator and throw on errors.
- WorksheetName String
- Worksheet name to create or update.
Outputs
System.Object
Export-OfficeExcel -Append [-AppendToTable] [-ApplicationName <String>] [-Author <String>] [-AutoFit] [-AutoFitFormattedColumn] [-BoldTopRow] [-Category <String>] [-ClearCachedFormulaResults] [-ColumnFormat <Hashtable>] [-Company <String>] [-CurrencyColumn <String[]>] [-DateColumn <String[]>] [-DateSystem <1900|1904|NineteenHundred|NineteenFour>] [-DateTimeColumn <String[]>] [-Description <String>] [-DisableFastPackageWriter] [-DocumentTitle <String>] [-EvaluateFormulas] [-ExcludeProperty <String[]>] [-ForceFullCalculationOnOpen] [-FormatCultureName <String>] [-FormatDecimals <Int32>] [-FreezeFirstColumn] [-FreezeTopRow] [-IgnoreMissingColumnFormat] [-IncludeHeaderInColumnFormat] [-IncludeUnexportableProperties] [-InputObject <Object>] [-IntegerColumn <String[]>] [-Keywords <String>] [-LastModifiedBy <String>] [-Manager <String>] [-MarkFormulasDirty] [-NoAutoFilter] [-NoClobber] [-NoHeader] [-NoRowStripes] [-NoTable] [-NumberColumn <String[]>] [-Open] [-PassThru] -Path <String> [-PercentColumn <String[]>] [-PropertyConversionErrorAction <SilentlyContinue>] [-SafePreflight] [-SafeRepairDefinedNames] [-ShowColumnStripes] [-ShowFirstColumn] [-ShowLastColumn] [-StartColumn <Int32>] [-StartRow <Int32>] [-Subject <String>] [-TableName <String>] [-TableStyle <String>] [-TextColumn <String[]>] [-Title <String>] [-ValidateOpenXml] [-WorksheetName <String>] [<CommonParameters>]#Parameter set:
AppendParameters
- Append SwitchParameter
- Append rows to an existing worksheet when the workbook exists.
- AppendToTable SwitchParameter
- Require append operations to extend an existing Excel table instead of writing after the used range.
- ApplicationName String
- Workbook application-name metadata.
- Author String
- Workbook author metadata.
- AutoFit SwitchParameter
- Auto-fit exported columns.
- AutoFitFormattedColumn SwitchParameter
- Auto-fit only columns that receive export-time column formats.
- BoldTopRow SwitchParameter
- Bold the exported header row.
- Category String
- Workbook category metadata.
- ClearCachedFormulaResults SwitchParameter
- Remove cached formula results before saving.
- ColumnFormat Hashtable
- Header-to-format map. Values may be preset names such as Text, Currency, Percent, Date, or custom Excel number formats.
- Company String
- Workbook company metadata.
- CurrencyColumn String[]
- Headers that should be formatted as currency.
- DateColumn String[]
- Headers that should be formatted as dates.
- DateSystem String
- Workbook date system for Excel date serials.
- Possible values:
1900,1904,NineteenHundred,NineteenFour - DateTimeColumn String[]
- Headers that should be formatted as date/time values.
- Description String
- Workbook description metadata.
- DisableFastPackageWriter SwitchParameter
- Disable OfficeIMO fast package writers for this save.
- DocumentTitle String
- Workbook document title metadata.
- EvaluateFormulas SwitchParameter
- Evaluate supported formulas and write cached values before saving.
- ExcludeProperty String[]
- Exclude specific properties from exported objects.
- ForceFullCalculationOnOpen SwitchParameter
- Request a full workbook recalculation when opened in Excel-compatible applications.
- FormatCultureName String
- Culture used by friendly currency column presets, such as en-US or pl-PL.
- FormatDecimals Int32
- Decimal places used by friendly number, percent, and currency column presets.
- FreezeFirstColumn SwitchParameter
- Freeze the first exported column.
- FreezeTopRow SwitchParameter
- Freeze the exported header row.
- IgnoreMissingColumnFormat SwitchParameter
- Continue when a requested export-time column format header is missing.
- IncludeHeaderInColumnFormat SwitchParameter
- Include header cells when applying export-time column formats.
- IncludeUnexportableProperties SwitchParameter
- Include properties that cannot be read by exporting a descriptive placeholder value.
- InputObject Object
- Objects to write. Accepts pipeline input.
- IntegerColumn String[]
- Headers that should be formatted as whole numbers.
- Keywords String
- Workbook keyword metadata.
- LastModifiedBy String
- Workbook last-modified-by metadata.
- Manager String
- Workbook manager metadata.
- MarkFormulasDirty SwitchParameter
- Mark formula cells dirty before saving.
- NoAutoFilter SwitchParameter
- Disable AutoFilter dropdowns on the created table.
- NoClobber SwitchParameter
- Do not overwrite an existing workbook unless appending or clearing a sheet.
- NoHeader SwitchParameter
- Do not emit a header row.
- NoRowStripes SwitchParameter
- Disable alternating row stripes for newly created tables.
- NoTable SwitchParameter
- Do not create an Excel table around the exported data.
- NumberColumn String[]
- Headers that should be formatted as decimal numbers.
- Open SwitchParameter
- Open the workbook after saving.
- PassThru SwitchParameter
- Emit the saved FileInfo.
- Path String
- Destination workbook path.
- PercentColumn String[]
- Headers that should be formatted as percentages.
- PropertyConversionErrorAction ActionPreference
- Controls how unreadable PowerShell properties are handled while projecting export rows.
- Possible values:
SilentlyContinue,Stop,Continue,Inquire,Ignore,Suspend,Break - SafePreflight SwitchParameter
- Run OfficeIMO worksheet preflight cleanup before saving.
- SafeRepairDefinedNames SwitchParameter
- Repair common defined-name issues before saving.
- ShowColumnStripes SwitchParameter
- Enable alternating column stripes for newly created tables.
- 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 new exports.
- StartRow Int32
- Starting row for new exports. When appending and left at 1, rows are written after the used range.
- Subject String
- Workbook subject metadata.
- TableName String
- Optional Excel table name.
- TableStyle String
- Built-in Excel table style name.
- TextColumn String[]
- Headers that should be formatted as text, useful for IDs, zip codes, and leading-zero values.
- Title String
- Write a title above the exported table.
- ValidateOpenXml SwitchParameter
- Validate the saved package with OpenXmlValidator and throw on errors.
- WorksheetName String
- Worksheet name to create or update.
Outputs
System.Object
Export-OfficeExcel [-ApplicationName <String>] [-Author <String>] [-AutoFit] [-AutoFitFormattedColumn] [-BoldTopRow] [-Category <String>] [-ClearCachedFormulaResults] -ClearSheet [-ColumnFormat <Hashtable>] [-Company <String>] [-CurrencyColumn <String[]>] [-DateColumn <String[]>] [-DateSystem <1900|1904|NineteenHundred|NineteenFour>] [-DateTimeColumn <String[]>] [-Description <String>] [-DisableFastPackageWriter] [-DocumentTitle <String>] [-EvaluateFormulas] [-ExcludeProperty <String[]>] [-ForceFullCalculationOnOpen] [-FormatCultureName <String>] [-FormatDecimals <Int32>] [-FreezeFirstColumn] [-FreezeTopRow] [-IgnoreMissingColumnFormat] [-IncludeHeaderInColumnFormat] [-IncludeUnexportableProperties] [-InputObject <Object>] [-IntegerColumn <String[]>] [-Keywords <String>] [-LastModifiedBy <String>] [-Manager <String>] [-MarkFormulasDirty] [-NoAutoFilter] [-NoClobber] [-NoHeader] [-NoRowStripes] [-NoTable] [-NumberColumn <String[]>] [-Open] [-PassThru] -Path <String> [-PercentColumn <String[]>] [-PropertyConversionErrorAction <SilentlyContinue>] [-SafePreflight] [-SafeRepairDefinedNames] [-ShowColumnStripes] [-ShowFirstColumn] [-ShowLastColumn] [-StartColumn <Int32>] [-StartRow <Int32>] [-Subject <String>] [-TableName <String>] [-TableStyle <String>] [-TextColumn <String[]>] [-Title <String>] [-ValidateOpenXml] [-WorksheetName <String>] [<CommonParameters>]#Parameter set:
ClearSheetParameters
- ApplicationName String
- Workbook application-name metadata.
- Author String
- Workbook author metadata.
- AutoFit SwitchParameter
- Auto-fit exported columns.
- AutoFitFormattedColumn SwitchParameter
- Auto-fit only columns that receive export-time column formats.
- BoldTopRow SwitchParameter
- Bold the exported header row.
- Category String
- Workbook category metadata.
- ClearCachedFormulaResults SwitchParameter
- Remove cached formula results before saving.
- ClearSheet SwitchParameter
- Replace the target worksheet inside an existing workbook.
- ColumnFormat Hashtable
- Header-to-format map. Values may be preset names such as Text, Currency, Percent, Date, or custom Excel number formats.
- Company String
- Workbook company metadata.
- CurrencyColumn String[]
- Headers that should be formatted as currency.
- DateColumn String[]
- Headers that should be formatted as dates.
- DateSystem String
- Workbook date system for Excel date serials.
- Possible values:
1900,1904,NineteenHundred,NineteenFour - DateTimeColumn String[]
- Headers that should be formatted as date/time values.
- Description String
- Workbook description metadata.
- DisableFastPackageWriter SwitchParameter
- Disable OfficeIMO fast package writers for this save.
- DocumentTitle String
- Workbook document title metadata.
- EvaluateFormulas SwitchParameter
- Evaluate supported formulas and write cached values before saving.
- ExcludeProperty String[]
- Exclude specific properties from exported objects.
- ForceFullCalculationOnOpen SwitchParameter
- Request a full workbook recalculation when opened in Excel-compatible applications.
- FormatCultureName String
- Culture used by friendly currency column presets, such as en-US or pl-PL.
- FormatDecimals Int32
- Decimal places used by friendly number, percent, and currency column presets.
- FreezeFirstColumn SwitchParameter
- Freeze the first exported column.
- FreezeTopRow SwitchParameter
- Freeze the exported header row.
- IgnoreMissingColumnFormat SwitchParameter
- Continue when a requested export-time column format header is missing.
- IncludeHeaderInColumnFormat SwitchParameter
- Include header cells when applying export-time column formats.
- IncludeUnexportableProperties SwitchParameter
- Include properties that cannot be read by exporting a descriptive placeholder value.
- InputObject Object
- Objects to write. Accepts pipeline input.
- IntegerColumn String[]
- Headers that should be formatted as whole numbers.
- Keywords String
- Workbook keyword metadata.
- LastModifiedBy String
- Workbook last-modified-by metadata.
- Manager String
- Workbook manager metadata.
- MarkFormulasDirty SwitchParameter
- Mark formula cells dirty before saving.
- NoAutoFilter SwitchParameter
- Disable AutoFilter dropdowns on the created table.
- NoClobber SwitchParameter
- Do not overwrite an existing workbook unless appending or clearing a sheet.
- NoHeader SwitchParameter
- Do not emit a header row.
- NoRowStripes SwitchParameter
- Disable alternating row stripes for newly created tables.
- NoTable SwitchParameter
- Do not create an Excel table around the exported data.
- NumberColumn String[]
- Headers that should be formatted as decimal numbers.
- Open SwitchParameter
- Open the workbook after saving.
- PassThru SwitchParameter
- Emit the saved FileInfo.
- Path String
- Destination workbook path.
- PercentColumn String[]
- Headers that should be formatted as percentages.
- PropertyConversionErrorAction ActionPreference
- Controls how unreadable PowerShell properties are handled while projecting export rows.
- Possible values:
SilentlyContinue,Stop,Continue,Inquire,Ignore,Suspend,Break - SafePreflight SwitchParameter
- Run OfficeIMO worksheet preflight cleanup before saving.
- SafeRepairDefinedNames SwitchParameter
- Repair common defined-name issues before saving.
- ShowColumnStripes SwitchParameter
- Enable alternating column stripes for newly created tables.
- 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 new exports.
- StartRow Int32
- Starting row for new exports. When appending and left at 1, rows are written after the used range.
- Subject String
- Workbook subject metadata.
- TableName String
- Optional Excel table name.
- TableStyle String
- Built-in Excel table style name.
- TextColumn String[]
- Headers that should be formatted as text, useful for IDs, zip codes, and leading-zero values.
- Title String
- Write a title above the exported table.
- ValidateOpenXml SwitchParameter
- Validate the saved package with OpenXmlValidator and throw on errors.
- WorksheetName String
- Worksheet name to create or update.
Outputs
System.Object