spreadsheetRemoveSheet

Deletes a spreadsheet.

spreadsheetRemoveSheet (spreadsheetObj, sheetname); → returns void

This function requires Adobe ColdFusion 9.0.1 and up.  Not supported on Lucee, etc.

Argument Reference

spreadsheetObj variableName
Required

The Excel spreadsheet object from which you delete the sheet.

sheetname string
Required

Name of the sheet that must be removed.

Examples
Sample code invoking the spreadsheetRemoveSheet function

<cfset spreadsheetVar= spreadsheetNew('New')> 
 <cfset spreadsheetCreateSheet(spreadsheetVar,'A')> 
 <cfset spreadsheetCreateSheet(spreadsheetVar,'B')> 
 <cfspreadsheet action='write' filename='#dirname#mySpreadSheet.xls'  name='spreadsheetVar' overwrite='true' > 
 <cfspreadsheet action='read' src='#dirname#mySpreadSheet.xls' name='spreadSheetVar' >     
 <cfset spreadsheetRemoveSheet(spreadsheetVar,'B')> 
 <cfspreadsheet action='write' filename='#dirname#mySpreadSheet.xls'  name='spreadsheetVar' overwrite='true' > 

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub