Cmdlet
Invoke-OfficeExcelAutoFit
Automatically fits Excel row heights and/or column widths.
Syntax
Invoke-OfficeExcelAutoFit
[-All]
[-Column <Int32[]>]
[-Columns]
[-Row <Int32[]>]
[-Rows]
[<CommonParameters>]#Parameter set:
ContextInvoke-OfficeExcelAutoFit
[-All]
[-Column <Int32[]>]
[-Columns]
-Document <ExcelDocument>
[-Row <Int32[]>]
[-Rows]
[-Sheet <String>]
[-SheetIndex <Int32>]
[<CommonParameters>]#Parameter set:
DocumentDescription
Targets the current worksheet context or a worksheet on a supplied document.
Examples
Auto-fit columns in the current DSL sheet.
ExcelSheet 'Data' { Invoke-OfficeExcelAutoFit -Columns }Adjusts column widths for the active sheet.
Parameters
- -All SwitchParameter
- Auto-fit both rows and columns.
- -Column Int32[]
- Auto-fit specific column indexes (1-based).
- -Columns SwitchParameter
- Auto-fit all columns.
- -Row Int32[]
- Auto-fit specific row indexes (1-based).
- -Rows SwitchParameter
- Auto-fit all rows.
- -Document ExcelDocument
- Workbook to operate on outside the DSL context.
- -Sheet String
- Worksheet name when using Document.
- -SheetIndex Int32
- Worksheet index (0-based) when using Document.
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.