Whatever message this page gives is out now! Go check it out!
SpreadsheetNew([sheetName, xmlformat]) |
Parameter | Type | Default | Description |
sheetName | String | None | A string containing the sheet name to assign to the Excel spreadsheet object. |
xmlFormat | Boolean | False | If true, the function creates a .xlsx file supported by Microsoft Office Excel 2007. If false, the function creates an .xls file. |
<cfset SpreadsheetObj = spreadsheetNew()> |
<cfset SpreadsheetObj = spreadsheetNew("mySheet")> |
<cfset SpreadsheetObj = spreadsheetNew("true")> |
<cfset SpreadsheetObj = spreadsheetNew("mysheet","yes")> |
<cfscript>
///We need an absolute path, so get the current directory path.
theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) & "newSpreadsheet.xls";
//Create a new Excel spreadsheet object.
theSheet = SpreadsheetNew("Expenses");
//Set the value a cell.
SpreadsheetSetCellValue(theSheet,"365",1,4);
</cfscript>
<!--- Write the spreadsheet to a file, replacing any existing file. --->
<cfspreadsheet action="write" filename="#theFile#" name="theSheet" overwrite=true>