-
-
Notifications
You must be signed in to change notification settings - Fork 40
write
Julian Halliwell edited this page Aug 22, 2025
·
16 revisions
Write a spreadsheet object to a file.
write( workbook, filepath [, overwrite [, password [, algorithm ] ] ] )
-
workbookspreadsheet object -
filepathstring: the absolute path of the file to be written.
-
overwriteboolean default=false: whether to overwrite an existing file -
passwordstring: if supplied the file will be encrypted and require the password to be opened.- Password-protection only works with XML format (.xlsx) spreadsheets
-
algorithmstring default="agile": algorithm/mode to use when encrypting a file. Possible values are agile, standard or binaryRC4- The available algorithms are not universally supported by spreadsheet software. You may find encrypted files cannot be opened depending on which algorithm you use to encrypt and which program you use to open the file.
- Note that binaryRC4 is apparently regarded as not very secure.
Chainable? Yes.
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 );
data = QueryNew( "First,Last", "VarChar,VarChar", [ [ "Susi","Sorglos" ], [ "Frumpo","McNugget" ] ] );
spreadsheet = New spreadsheet();
workbook = spreadsheet.workbookFromQuery( data=data, xmlFormat=true);
path = "C:/temp/test.xlsx";
spreadsheet.write( workbook, path, "secret" );