-
-
Notifications
You must be signed in to change notification settings - Fork 36
write
Julian Halliwell edited this page Sep 20, 2021
·
14 revisions
Write a spreadsheet object to a file.
write( workbook, filepath [, overwrite [, password [, algorithm ] ] ] )
-
workbook
spreadsheet object -
filepath
string: the absolute path of the file to be written.
-
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. - Password-protection only works with XML format (.xlsx) spreadsheets, and is not available in Adobe ColdFusion
-
algorithm
string 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" );