Method Remove
Remove(int, int)
Takes a cell out of the sheet altogether: value, formula and format. Nothing moves; the cells around it stay where they are.
public void Remove(int row, int column)
Parameters
Exceptions
- ArgumentOutOfRangeException
The row or the column is outside the worksheet grid.
- InvalidOperationException
The sheet is not a worksheet.
- UnsupportedFeatureException
The cell is part of an array formula entered over several cells, or is a header or totals cell of a table.
- InvalidDocumentException
The sheet's part is malformed.
Remove(string)
Takes a cell out of the sheet by its reference. See Remove(int, int).
public void Remove(string reference)
Parameters
referencestringThe reference, such as
B4.
Exceptions
- ArgumentNullException
referenceis null.- ArgumentException
referenceis not a cell reference inside the worksheet grid.- InvalidOperationException
The sheet is not a worksheet.
- UnsupportedFeatureException
The cell is part of an array formula entered over several cells, or is a header or totals cell of a table.
- InvalidDocumentException
The sheet's part is malformed.