Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

ExcelSaveOptions

OfficeIMO.Excel

Namespace
OfficeIMO.Excel
Assembly
OfficeIMO.Excel
Source revision
0eef6a5756b9 with working tree changes
Modifiers
sealed

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.

Accepted by parameters 5

Constructors

public ExcelSaveOptions() #

Methods

public ExcelSaveOptions Clone() #

Returns an independent copy, preserving whether an output password was explicitly assigned.

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? XlsbUseSharedStrings { get; set; } #

Selects string storage when creating a native XLSB workbook. true deduplicates text cells in a shared-string table; false writes inline strings. The default null preserves the normal inline output for new workbooks and the original storage of imported XLSB packages. Shared strings retain each distinct text value in memory during save. Explicit values are rejected for imported XLSB workbooks and for output formats other than XLSB before the destination is written.

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.

Fields

public const long DefaultMaxInMemoryPackageBytes #

Default maximum package size materialized by save operations: 256 MiB.

Value: 268435456
public const long DefaultMaxTemporaryPackageBytes #

Default maximum temporary package size staged for a non-seekable destination: 256 MiB.

Value: 268435456