Table of Contents

Method Save

Namespace
DocWright.Spreadsheet.Security
Assembly
DocWright.Spreadsheet.Security.dll

Save(XlsxDocument, Stream, AgileEncryptionSettings, XlsxWriteSettings?)

Saves a workbook encrypted with a password, as Excel's Encrypt with Password does: agile encryption with the settings' key size, hash and spin count (Excel's own by default: AES-256, SHA-512, 100,000 spins).

public static void Save(XlsxDocument document, Stream output, AgileEncryptionSettings encryption, XlsxWriteSettings? settings = null)

Parameters

document XlsxDocument

The workbook.

output Stream

The stream the encrypted file is written to.

encryption AgileEncryptionSettings

The password and the encryption's parameters.

settings XlsxWriteSettings

The options the workbook is written with, or null.

Exceptions

ArgumentNullException

An argument but settings is null.

ResourceLimitExceededException

The workbook passes MaxOutputBytes.