Table of Contents

Method WriteBack

Namespace
OpenCAD2D
Assembly
OpenCAD2D.Core.dll

WriteBack(string, string, int, int, CadSheet)

Writes cells into a sheet of a workbook, as AutoCAD writes a data link's cells back to its source: each cell of values put at its place from the first cell given, a text as an inline string and a number as a value; every other part of the workbook, its styles, its other sheets and its formulas, kept as it was. A cell that holds a formula is left as it is.

public static int WriteBack(string path, string sheetName, int topRow, int leftColumn, CadSheet values)

Parameters

path string

The workbook's file.

sheetName string

The sheet.

topRow int

The row of the first cell, from nought.

leftColumn int

The column of the first cell, from nought.

values CadSheet

The cells.

Returns

int

The number of cells written.

Exceptions

ArgumentNullException

Thrown when the path, the sheet's name or the values are null.

ArgumentException

Thrown when the workbook has no such sheet.

IOException

Thrown when the file cannot be written, as one open in Excel cannot.