API Reference

Cmdlet

Set-OfficeExcelExecutionPolicy

Aliases: ExcelExecutionPolicy
Namespace PSWriteOffice
Aliases
ExcelExecutionPolicy
Inputs
OfficeIMO.Excel.ExcelDocument
Outputs
OfficeIMO.Excel.ExcelDocument

Configures OfficeIMO Excel execution and validation behavior for a workbook.

Remarks

Configures OfficeIMO Excel execution and validation behavior for a workbook.

Examples

Authored help example

Force sequential execution for a workbook.

PS>


$workbook | Set-OfficeExcelExecutionPolicy -Mode Sequential
        

Disables automatic parallel execution decisions for subsequent OfficeIMO operations.

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

Set-OfficeExcelExecutionPolicy [-Diagnostics] [-DisableAutoFitImmediateSave] [-MaxDegreeOfParallelism <Nullable`1>] [-Mode <Automatic|Sequential|Parallel>] [-ParallelThreshold <Nullable`1>] [-PassThru] [-WorksheetValidation <Disabled|DiagnosticsOnly|DebugOnly|Always>] [<CommonParameters>]
#
Parameter set: Context

Parameters

Diagnostics SwitchParameter optionalposition: namedpipeline: False
Request diagnostics-aware validation without wiring verbose callbacks.
DisableAutoFitImmediateSave SwitchParameter optionalposition: namedpipeline: False
Do not save worksheet parts immediately after AutoFit width/height mutations.
MaxDegreeOfParallelism Nullable`1 optionalposition: namedpipeline: False
Optional cap for parallel compute phases.
Mode String optionalposition: namedpipeline: Falsevalues: 3
Execution mode for large operations.
Possible values: Automatic, Sequential, Parallel
ParallelThreshold Nullable`1 optionalposition: namedpipeline: False
Global item threshold above which Automatic mode switches to Parallel.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the workbook after updating the policy.
WorksheetValidation String optionalposition: namedpipeline: Falsevalues: 4
Worksheet validation mode for write operations.
Possible values: Disabled, DiagnosticsOnly, DebugOnly, Always

Outputs

OfficeIMO.Excel.ExcelDocument

Set-OfficeExcelExecutionPolicy [-Diagnostics] [-DisableAutoFitImmediateSave] -Document <ExcelDocument> [-MaxDegreeOfParallelism <Nullable`1>] [-Mode <Automatic|Sequential|Parallel>] [-ParallelThreshold <Nullable`1>] [-PassThru] [-WorksheetValidation <Disabled|DiagnosticsOnly|DebugOnly|Always>] [<CommonParameters>]
#
Parameter set: Document

Parameters

Diagnostics SwitchParameter optionalposition: namedpipeline: False
Request diagnostics-aware validation without wiring verbose callbacks.
DisableAutoFitImmediateSave SwitchParameter optionalposition: namedpipeline: False
Do not save worksheet parts immediately after AutoFit width/height mutations.
Document ExcelDocument requiredposition: 0pipeline: True (ByValue)
Workbook whose execution policy should be updated.
MaxDegreeOfParallelism Nullable`1 optionalposition: namedpipeline: False
Optional cap for parallel compute phases.
Mode String optionalposition: namedpipeline: Falsevalues: 3
Execution mode for large operations.
Possible values: Automatic, Sequential, Parallel
ParallelThreshold Nullable`1 optionalposition: namedpipeline: False
Global item threshold above which Automatic mode switches to Parallel.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the workbook after updating the policy.
WorksheetValidation String optionalposition: namedpipeline: Falsevalues: 4
Worksheet validation mode for write operations.
Possible values: Disabled, DiagnosticsOnly, DebugOnly, Always

Outputs

OfficeIMO.Excel.ExcelDocument