Method Merge
- Namespace
- DocWright.Spreadsheet
- Assembly
- DocWright.Spreadsheet.dll
Merge(XlsxDocument, XlsxMergeOptions?)
Appends every sheet of another workbook to this one.
public IReadOnlyList<XlsxDocumentSheet> Merge(XlsxDocument other, XlsxMergeOptions? options = null)
Parameters
otherXlsxDocumentThe other workbook. It is not changed.
optionsXlsxMergeOptionsThe options, or null for the defaults.
Returns
- IReadOnlyList<XlsxDocumentSheet>
The sheets added, in the order they have in the other workbook.
Remarks
Each sheet comes as CopySheetFrom(XlsxDocumentSheet, string?) brings one, with this difference: the
sheets come together, so a reference from one of them to another still means that
sheet, under whatever name it has here. A sheet whose name this workbook has gets the
name and (2).
Exceptions
- ArgumentNullException
otheris null.- ArgumentException
otheris this workbook.- UnsupportedFeatureException
A sheet cannot be copied between workbooks; see CopySheetFrom(XlsxDocumentSheet, string?). Nothing has been added.
- InvalidDocumentException
A part of either workbook is malformed.