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
namestringThe range's title, unique on the sheet.
rangestringThe cells, as
B2:C4(several ranges separated by spaces).passwordstringThe password that unlocks it, or null.
Returns
- XlsxAllowEditRange
The range.
Exceptions
- ArgumentNullException
nameorrangeis 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.