Project

PSWriteOffice

PowerShell document automation across Word, Excel, PowerPoint, PDF, Reader, Confluence, Visio, and open text formats.

Stars 159
Forks 14
PowerShell Gallery downloads 158,661
Release v3.0.5
Language: C# Updated: 2026-09-03

API Reference

Cmdlet

Save-OfficeExcel

Namespace PSWriteOffice
Inputs
OfficeIMO.Excel.ExcelDocument
Outputs
OfficeIMO.Excel.ExcelDocument

Saves an Excel workbook without disposing it.

Remarks

Saves an Excel workbook without disposing it.

Examples

Authored help example

Save a workbook in-place.

PS>


$workbook | Save-OfficeExcel
        

Writes pending changes to disk and keeps the workbook open.

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

Save-OfficeExcel [-ClearCachedFormulaResults] [-DateSystem <1900|1904|NineteenHundred|NineteenFour>] [-DisableFastPackageWriter] -Document <ExcelDocument> [-EvaluateFormulas] [-ForceFullCalculationOnOpen] [-MarkFormulasDirty] [-Open] [-PassThru] [-Password <String>] [-Path <String>] [-SafePreflight] [-SafeRepairDefinedNames] [-ValidateOpenXml] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

ClearCachedFormulaResults SwitchParameter optionalposition: namedpipeline: False
Remove cached formula results before saving.
DateSystem String optionalposition: namedpipeline: Falsevalues: 4
Workbook date system for Excel date serials.
Possible values: 1900, 1904, NineteenHundred, NineteenFour
DisableFastPackageWriter SwitchParameter optionalposition: namedpipeline: False
Disable OfficeIMO fast package writers for this save.
Document ExcelDocument requiredposition: 0pipeline: True (ByValue)
Workbook to save.
EvaluateFormulas SwitchParameter optionalposition: namedpipeline: False
Evaluate supported formulas and write cached values before saving.
ForceFullCalculationOnOpen SwitchParameter optionalposition: namedpipeline: False
Request a full workbook recalculation when opened in Excel-compatible applications.
MarkFormulasDirty SwitchParameter optionalposition: namedpipeline: False
Mark formula cells dirty before saving.
Open SwitchParameter optionalposition: namedpipeline: Falsealiases: Show
Open the workbook after saving.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the workbook for further processing.
Password String optionalposition: namedpipeline: False
Password used to save the workbook as an encrypted package.
Path String optionalposition: namedpipeline: False
Optional save-as path.
SafePreflight SwitchParameter optionalposition: namedpipeline: False
Run OfficeIMO worksheet preflight cleanup before saving.
SafeRepairDefinedNames SwitchParameter optionalposition: namedpipeline: False
Repair common defined-name issues before saving.
ValidateOpenXml SwitchParameter optionalposition: namedpipeline: False
Validate the saved package with OpenXmlValidator and throw on errors.

Outputs

OfficeIMO.Excel.ExcelDocument