xlsgen > overview > Workbook |
Workbook is the first object instance you create from a running xlsgen instance.
You can create or open existing workbooks on a storage device using a fully qualified filepath (hard drive, remote directory, ...) or in memory.
Starting with a workbook, you can create an arbitrary number of worksheets.
There are a number of options available from the IXlsWorkbook object interface :
FactorizedStringsMode
: stores the same label only once (smaller Excel files)
FactorizedFloatsMode
: tries to factorize adjacents floating-point values (smaller Excel files)
StyleOption
: defines whether altering an existing workbook should affect the style and the content simultaneously.
FormulaLanguage
: sets the locale language to use for reading and writing formulas. xlsgen supports English and French.
IgnoreErrorNumberAsText
: in Excel itself, avoids showing a green triangle in the top-left corner of cells where a number is stored as a string. Applies to Excel XP and above only (it will not cause crashes in earlier Excel versions).
CalculationOptions
: defines the behavior of the calculation engine, particularly in regards to the retained mode (auto-recalc).
ExcelTargetVersion
: sets the version of Excel to target. It is useful with formulas if you'd like to avoid that Excel brings a user prompt when closing a document.
Workbook properties
: lets you read and write the document summary properties such as the Author, Title, Date, ...
Named Ranges
: lets you retrieve and edit existing named ranges.
EnforceDataValidation
: enables/disables the enforcement of data validation rules when data is added in the spreadsheet.
AutoAdjustDefinedNames
: enables/disables the auto-adjusting of defined names when new data is added to rows or columns. The adjusting mechanism works by monitoring whenever data is added in rows just below the range of a defined name, or a column just on the right of the range of a defined name. The adjusting simply inflates the range to include said data.
Arabic
: allows to set whether or not the spreadsheet should use the Arabic user interface (right-to-left).
AutoOpenExternalWorkbookReference
: enables/disables the automatic opening of external workbooks whenever formulas need it.
Commit
: enables/disables whether the changes should be committed into the output file.
DisplaySheetTabs
: enables/disables the workbook to display the sheet tabs.
DisplayRowHeadings
: enables/disables the workbook to display row headings in sheets.
ShowZeros
: enables/disables the workbook to display zeros in sheets.
IsUsing1904Dates
: lets know if the spreadsheet uses 1904-offset dates, often a default on spreadsheets created with a Mac computer.
GridA1Mode
: allows to set whether or not the spreadsheet uses numeric column headers as opposed to alphabetic column headers, as well as the way cell references in formulas are displayed, using numeric coding or an alphabetic coding.
TreatFloatsAsStrings
: allows to set whether or not the spreadsheet returns that floats are strings in CellType() whenever the floats are actually stored as strings. Off by default (i.e. returns float data type).
VBAMacros
: allows to retrieve the VBA macros at the workbook level, in plain text.
VBAModules
: allows to retrieve the VBA macros present in modules in the spreadsheet, in plain text.
EncryptionPassword
: allows to set an encryption password for encrypting XLS and XLSX files.
Theme
: allows to set or retrieve the default theme used mainly for charts.
ChartEngine
: allows to use the built-in chart engine (by default) or the Microsoft Charting component (compatibility purpose).
PDFEngine
: allows to use the rewritten PDF engine (by default), with scalable text, or the PDF engine that was used so far (compatibility purpose).
ExternalReferences
: allows to list all external references present in the current workbook.
InsertFillOption
: allows to control how the insert row and insert col features behave. By default blanks in new rows and columns have the same formatting than the row above and column on the left. Or blanks can remain blank.
FormulaDefinitionUpdate
: allows to control whether or not the definition of formulas in the workbook are translated when rows or columns are inserted or deleted.