Cmdlet
Clear-OfficeExcelAutoFilter
Clears any AutoFilter on the current worksheet.
Syntax
Clear-OfficeExcelAutoFilter
[-Document <ExcelDocument>]
[-PassThru]
[-Sheet <OfficeSheetSelector>]
[<CommonParameters>]#Parameter set:
DefaultExamples
Remove the AutoFilter from a sheet
Open-OfficeExcel -Path .\Reports\Helpdesk.xlsx {
ExcelSheet 'Tickets' {
Clear-OfficeExcelAutoFilter
}
}Removes the filter buttons and any filter conditions from the Tickets sheet.
Clear filters before sharing a workbook
$book = Open-OfficeExcel -Path .\Reports\Q3-Sales.xlsx
foreach ($sheet in 'Orders', 'Returns', 'Customers') {
Clear-OfficeExcelAutoFilter -Document $book -Sheet $sheet
}
Save-OfficeExcel -Document $book -Path .\Outbox\Q3-Sales.xlsx -PassThru | Close-OfficeExcelRemoves the filters left on the working sheets so recipients see every row.
Parameters
- -Document ExcelDocument
- Workbook to operate on outside the DSL context.
- -PassThru SwitchParameter
- Emit the object created or changed by the command.
- -Sheet OfficeSheetSelector
- Worksheet name 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.