Skip to content
Julian Halliwell edited this page Dec 15, 2015 · 16 revisions

Write a spreadsheet object to a file.

write( workbook, filepath[, overwrite, password ] )

##Required arguments

  • workbook spreadsheet object
  • filepath string: the absolute path of the file to be written.

##Optional arguments

  • overwrite boolean default=false: whether to overwrite an existing file
  • password string: if supplied the file will be encrypted and require the password to be opened. Only works with XML format (.xlsx) spreadsheets. Also not all spreadsheet programs support the encryption used.

##Example

data = QueryNew( "First,Last","VarChar,VarChar",[ [ "Susi","Sorglos" ],[ "Frumpo","McNugget" ] ] );
spreadsheet = New spreadsheet();
workbook = spreadsheet.workbookFromQuery( data );
path = "C:/temp/test.xls";
spreadsheet.write( workbook,path );

Clone this wiki locally