Table of Contents

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

other XlsxDocument

The other workbook. It is not changed.

options XlsxMergeOptions

The 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

other is null.

ArgumentException

other is 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.