Method Merge
Merge(XlsxCellRange)
Merges a range of cells into one.
public void Merge(XlsxCellRange range)
Parameters
rangeXlsxCellRangeThe range. It must cover more than one cell.
Remarks
The cells keep what they hold; Excel shows the first cell's content across the range, as it does for a merge made in Excel over cells that had values.
Exceptions
- ArgumentException
The range is a single cell, reaches outside the worksheet grid, or overlaps a range that is already merged.
- InvalidOperationException
The sheet is not a worksheet.
- UnsupportedFeatureException
The range overlaps a table. Excel refuses a workbook with a merge inside a table.
- InvalidDocumentException
The sheet's part is malformed.