Skip to content
Julian Halliwell edited this page Mar 6, 2024 · 12 revisions

Returns a new spreadsheet workbook object in binary or XML format.

new( [sheetName [, xmlFormat [, streamingXml [, streamingWindowSize  ] ] ] ] )

Optional arguments

  • sheetName string: name to give the default sheet in the new workbook.
  • xmlFormat boolean default=false: whether the format for the new workbook should be Excel 2007 XML (".xlsx").
  • streamingXml boolean default=false: whether to create a memory-efficient streaming XML spreadsheet
  • streamingWindowSize integer: (positive integer greater than 0) the maximum number of rows that are kept in memory at once while populating a streaming spreadsheet, before being flushed to disk.

Workbook formats

By default a "binary" or ".xls" workbook object will be returned. From version 4.0 if you wish this method to always return an XML (or ".xlsx") workbook without having to specify xmlFormat=true, you can use the setDefaultWorkbookFormat() configuration option. Alternatively you can use newXlsx().

Example

spreadsheet = New spreadsheet();
workbook = spreadsheet.new();
Clone this wiki locally