Set-SLAutoFitColumn


Synopsis

Autofit columns by ColumnName or ColumnIndex.

Syntax

Description

Autofit columns by ColumnName or ColumnIndex. A single or a range of columns by name or index can be specified as input.

Parameters

-WorkBookInstance

Instance of an excel document that can be used for editing.

Required? True
Position? 0
Default value  
Accept pipeline input? true (ByValue)
Accept wildcard characters? False

-WorksheetName

Name of the Worksheet that is to be processed.

Required? False
Position? 1
Default value  
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? False

-MaximumColumnWidth

Specifies the maximum column width for a column or range after autofit is applied. Eg: 10.

Required? False
Position? named
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-ColumnName

The columnName to be autofit. Eg: A or G.

Required? True
Position? 2
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-ColumnIndex

The columnIndex to be autofit. Eg: 1 or 5.

Required? True
Position? 2
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-StartColumnName

Specifies the start of the autofit column range. Eg: A.

Required? True
Position? named
Default value  
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? False

-ENDColumnName

Specifies the end of the autofit column range. Eg: G.

Required? True
Position? named
Default value  
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? False

-StartColumnIndex

Specifies the start of the autofit column range. Eg: 1.

Required? True
Position? named
Default value  
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? False

-ENDColumnIndex

Specifies the end of the autofit column range. Eg: 5.

Required? True
Position? named
Default value  
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? False

This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

Inputs

String,Int,SpreadsheetLight.SLDocument

Outputs

SpreadsheetLight.SLDocument

Notes

Examples

Example 1

Autofit column F by Name .

Example 2

Autofit columns from F to H by Name.

Example 3

Autofit columns from F to H by Name and optionally set a maxcolumnwidth of 10.

Related links