Cmdlet
Set-OfficeExcelSheet
Sets worksheet visibility, tab color and the active worksheet.
Syntax
Set-OfficeExcelSheet
[-Active]
[-Document <ExcelDocument>]
[-PassThru]
[-Sheet <OfficeSheetSelector>]
[-TabColor <OfficeColor>]
[-Visibility <Visible| Hidden| VeryHidden>]
[<CommonParameters>]#Parameter set:
DefaultSet-OfficeExcelSheet
[-Active]
[-Document <ExcelDocument>]
-NoTabColor
[-PassThru]
[-Sheet <OfficeSheetSelector>]
[-Visibility <Visible| Hidden| VeryHidden>]
[<CommonParameters>]#Parameter set:
NoTabColorDescription
Omitted properties keep their values. Sheet accepts a name, one-based position or native worksheet. Inside an ExcelSheet block it defaults to the current worksheet; an explicit workbook defaults to its first sheet.
Examples
Hide lookup data and open on the summary.
Open-OfficeExcel -Path .\Pricing.xlsx {
Set-OfficeExcelSheet -Sheet Lookups -Visibility VeryHidden -TabColor Accent2
Set-OfficeExcelSheet -Sheet Summary -Active
}Clear a live worksheet's tab color.
$book | Set-OfficeExcelSheet -Sheet 2 -NoTabColor -PassThruParameters
- -Active SwitchParameter
- Gets or sets whether this visible worksheet opens as the workbook's active worksheet.
- -Document ExcelDocument
- Gets or sets an explicit live document; omission uses the enclosing content block.
- -PassThru SwitchParameter
- Gets or sets whether to emit the edited native worksheet.
- -Sheet OfficeSheetSelector
- Gets or sets a worksheet name, one-based position or native worksheet belonging to the workbook.
- -TabColor OfficeColor
- Gets or sets the literal or theme-based tab color.
- -Visibility ExcelSheetVisibility
- Gets or sets Visible, Hidden or VeryHidden; omission preserves visibility.
- Possible values:
Visible,Hidden,VeryHidden - -NoTabColor SwitchParameter
- Gets or sets whether to remove the tab color; exclusive with TabColor.
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.