ExcelSaveOptions
OfficeIMO.Excel
Optional behaviors applied during ExcelDocument.Save and ExcelDocument.SaveAsync to strengthen robustness and CI validation.
Inheritance
- object
- ExcelSaveOptions
Usage
Explore 8 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 3
- Method ExcelSaveOptions.Clone
- Property ExcelSaveOptions.Default
- Property ExcelWriterOptions.SaveOptions
Accepted by parameters 5
- Method ExcelDocument.Save
- Method ExcelDocument.SaveAsync
- Method ExcelDocument.SaveCopy
- Method ExcelDocument.SaveCopyAsync
- Method ExcelDocument.ToBytes
Constructors
public ExcelSaveOptions() #Methods
public ExcelSaveOptions Clone() #Returns an independent copy, preserving whether an output password was explicitly assigned.
Returns
ExcelSaveOptionsInherited Methods
Properties
public ExcelFileFormat Format { get; set; } #Native physical format for streams and byte output. File paths select their format by extension.
public string? Password { get; set; } #Output password. Assign null explicitly to remove encryption; an unset value preserves loaded encryption.
public long? MaxInMemoryPackageBytes { get; set; } #Maximum package size that may be materialized in memory while saving. The default is 256 MiB. Set to null only for explicitly trusted, intentionally larger workbooks.
public long? MaxTemporaryPackageBytes { get; set; } #Maximum package size that may be staged in a temporary file when a target framework requires a seekable package destination. The default is 256 MiB. Set to null only for explicitly trusted, intentionally larger workbooks.
public bool SafeRepairDefinedNames { get; set; } #When true, attempts to repair common defined-name issues (duplicates, out-of-range LocalSheetId, #REF!) before save.
public bool ValidateOpenXml { get; set; } #When true, validates the saved package using OpenXmlValidator and throws on any errors.
public bool SafePreflight { get; set; } #When true, performs a safety preflight on all worksheets before saving, removing empty containers (e.g., empty Hyperlinks/MergeCells), dropping orphaned drawing/header-footer references, and cleaning up invalid table references. This can prevent rare "Repaired Records" notices in Excel.
public bool DisableFastPackageWriter { get; set; } #When true, disables direct fast package writers and always uses the standard save finalization path.
public bool EvaluateFormulasBeforeSave { get; set; } #When true, evaluates supported formulas and writes cached values before this save. Unsupported formulas are preserved for Excel-compatible applications to calculate.
public bool ClearCachedFormulaResultsBeforeSave { get; set; } #When true, removes cached formula results before this save. Ignored when ExcelSaveOptions.EvaluateFormulasBeforeSave is true.
public bool MarkFormulasDirtyBeforeSave { get; set; } #When true, marks formulas dirty before this save so Excel-compatible applications recalculate on open.
public bool ForceFullCalculationOnOpen { get; set; } #When true, writes workbook calculation properties requesting a full recalculation on open.
public bool AllowLoss { get; set; } #Controls saves of workbooks projected from legacy XLS files when known legacy-only content cannot be represented by the selected output format. The default blocks the save.
public OfficeSignatureMutationPolicy SignatureMutationPolicy { get; set; } #Gets or sets how save operations handle digital-signature metadata. The safe default blocks package rewriting; removing or preserving invalidated markup must be selected explicitly.
public static ExcelSaveOptions Default { get; } #Returns a fresh options instance with the default save policy.