Table of Contents

Class CadWorkbook

Namespace
OpenCAD2D
Assembly
OpenCAD2D.Core.dll

An Excel workbook of the .xlsx kind (Office Open XML), read and written by the presenter's own small code, with no Excel and no other package: its sheets and named ranges, the values the file holds (a formula gives the value last worked out and kept with it, no formula is evaluated), shared and inline texts, numbers shown as their formats show them, dates, and a cell's alignment, fill and font colour. A workbook of the older .xls kind is not read.

public sealed class CadWorkbook
Inheritance
CadWorkbook
Inherited Members

Properties

NamedRanges

Gets the named ranges of the workbook, each name with the cells it names as the workbook writes them, Sheet1!$A$1:$C$5; a name of a formula or of a sheet's own scope is not among them.

SheetNames

Gets the names of the sheets, in the order of the workbook's tabs.

Methods

Open(string)

Opens a workbook.

ReadSheet(string)

Reads a sheet.

Write(string, string, CadSheet)

Writes a new workbook of one sheet, as a data extraction writes its .xlsx file: texts as inline strings, numbers and booleans as values, a date as its number under the date format of the workbook's own styles.

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.