You can find the CFFiddle demo of this function and other spreadsheet functions as part of a project that is shared with you.

Click the button below to launch CFFiddle.

To copy the project in your workspace in CFFiddle, follow the steps below:

  1. Log in with your Gmail or Facebook credentials.
  2. Navigate to the project in the left pane.
  3. Once you make some changes in any cfm in the project, a pop up displays asking you to save the project.
  4. Give the project a suitable name and click Save.


Creates a ColdFusionExcel spreadsheet object, which represents a single sheet of an Excel document.


ColdFusionExcel spreadsheet object.


Microsoft Office Integration

Function syntax

SpreadsheetNew([sheetName, xmlformat])

See also

All Other Spreadsheet functions; see Microsoft Office Integration list.


ColdFusion 9: Added the function.





A string containing the sheet name to assign to the Excel spreadsheet object.


A Boolean value.True or Yes: Creates a .xlsx file that is supported by Microsoft Office Excel 2007.False or No: Creates a .xls file.


This function supports Microsoft Office Excel 2007. To create a simple .xls spreadsheet object with a default worksheet name, your code can be as follows:

<cfset SpreadsheetObj = spreadsheetNew()>

To create a simple .xls spreadsheet object by specifying the worksheet name as "mySheet", your code can be as follows:

<cfset SpreadsheetObj = spreadsheetNew("mySheet")>

To create spreadsheet objects that are supported by Microsoft Office Excel 2007 (.xlsx), your code can be as follows:

<cfset SpreadsheetObj = spreadsheetNew("true")>


<cfset SpreadsheetObj = spreadsheetNew("mysheet","yes")>


Note: You can specify either "true" or "yes" to create a .xlsx file.


The following example creates an Excel spreadsheet object with the sheet name Expenses, sets a cell value, and saves the result to a file.

///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.

<!--- Write the spreadsheet to a file, replacing any existing file. --->
<cfspreadsheet action="write" filename="#theFile#" name="theSheet" overwrite=true>
Adobe logo

Sign in to your account