Method Create
- Namespace
- DocWright.Spreadsheet
- Assembly
- DocWright.Spreadsheet.dll
Create(XlsxCreateSettings?)
Starts a workbook from nothing: one empty sheet, the default look, and nothing else.
public static XlsxDocument Create(XlsxCreateSettings? settings = null)
Parameters
settingsXlsxCreateSettingsThe sheet's name, the default font and the date system, or null for what Excel gives a new workbook.
Returns
- XlsxDocument
The workbook. Everything an opened workbook can be asked or told, this one can.
Remarks
The workbook is the shape of Excel's own new workbook, less what identifies a save: a workbook part, one sheet, a style part (one font, the two reserved fills, one border, the Normal style) and a theme, and no document properties. Excel opens the saved file as it opens its own, without repairing it.
Two calls with the same settings give workbooks whose saves are the same bytes: nothing in the package is a time, an id or a path.
IsModified is false until something is changed.
Exceptions
- ArgumentException
FirstSheetName is not a sheet name Excel accepts, or holds a character a workbook cannot store; DefaultFontFamily is null, empty, longer than 31 characters or holds a control character; or DefaultFontSizePoints is outside 1 to 409.