Table of Contents

Method Add

Namespace
DocWright.Spreadsheet
Assembly
DocWright.Spreadsheet.dll

Add(string, string, string?)

Adds a range users may edit while the sheet is protected, as Excel's Allow Edit Ranges does: with a password (hashed as Excel hashes it: SHA-512, a random salt, 100,000 spins) or none.

public XlsxAllowEditRange Add(string name, string range, string? password = null)

Parameters

name string

The range's title, unique on the sheet.

range string

The cells, as B2:C4 (several ranges separated by spaces).

password string

The password that unlocks it, or null.

Returns

XlsxAllowEditRange

The range.

Exceptions

ArgumentNullException

name or range is null.

ArgumentException

The title is empty, taken or not storable, or the range is not cells of the grid.

InvalidOperationException

The sheet is not a worksheet.