Method Remove
- Namespace
- DocWright.Spreadsheet
- Assembly
- DocWright.Spreadsheet.dll
Remove(XlsxCellRange)
Removes the validation of a range, as Excel's Clear All in Data Validation does: every rule gives up the cells in the range, and a rule left with none goes. The cells keep their values.
public int Remove(XlsxCellRange range)
Parameters
rangeXlsxCellRangeThe range.
Returns
- int
How many rules gave up cells (those removed included).
Exceptions
- InvalidOperationException
The sheet is not a worksheet.
- InvalidDocumentException
A part of the workbook is malformed.
Remove(XlsxDataValidation)
Removes one rule, with all its cells.
public bool Remove(XlsxDataValidation validation)
Parameters
validationXlsxDataValidationThe rule, as read from this list.
Returns
- bool
Whether the sheet still had the rule.
Exceptions
- ArgumentNullException
validationis null.- InvalidOperationException
The sheet is not a worksheet.
- InvalidDocumentException
A part of the workbook is malformed.