Last updated on
Feb 25, 2025
Description
Clears all styles and values from a specified cell.
Returns
None
History
ColdFusion (2025 release): Added the function.
Syntax
spreadsheetClearCell(spreadSheetObject,row,column)
spreadsheetClearCell(spreadSheetObject,row,column)
spreadsheetClearCell(spreadSheetObject,row,column)
Parameters
Name
|
Required
|
Type
|
Description
|
spreadSheetObject
|
Yes
|
ExcelInfo
|
The Excel spreadsheet object from which to clear the specified cell.
|
row
|
Yes
|
Integer
|
The row number of the cell to be cleared.
|
column
|
Yes
|
Integer
|
The column number of the cell to be cleared.
|
Example
<cfquery name="art" datasource="art">
SELECT * FROM ART
</cfquery>
<cfscript>
theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) & "art.xls";
// create a spreadsheet object
theSheet=spreadsheetNew("SampleData")
// add rows from query
spreadsheetAddRows(theSheet,art)
// writeOutput(theFile)
// Define the structure for formatting a cell
myFormat=StructNew();
myFormat.color="blue";
myFormat.bold="true";
myFormat.underline="true";
myFormat.alignment="center";
myFormat.rotation=45;
myFormat.italic="true"
// Set formatting to cell (10,5)
SpreadsheetFormatCell(theSheet,myFormat,10,4)
// clear the format
spreadsheetClearCell(theSheet,10,4)
spreadsheetWrite(theSheet,theFile,"yes")
</cfscript>
<cfquery name="art" datasource="art">
SELECT * FROM ART
</cfquery>
<cfscript>
theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) & "art.xls";
// create a spreadsheet object
theSheet=spreadsheetNew("SampleData")
// add rows from query
spreadsheetAddRows(theSheet,art)
// writeOutput(theFile)
// Define the structure for formatting a cell
myFormat=StructNew();
myFormat.color="blue";
myFormat.bold="true";
myFormat.underline="true";
myFormat.alignment="center";
myFormat.rotation=45;
myFormat.italic="true"
// Set formatting to cell (10,5)
SpreadsheetFormatCell(theSheet,myFormat,10,4)
// clear the format
spreadsheetClearCell(theSheet,10,4)
spreadsheetWrite(theSheet,theFile,"yes")
</cfscript>
<cfquery name="art" datasource="art"> SELECT * FROM ART </cfquery> <cfscript> theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) & "art.xls"; // create a spreadsheet object theSheet=spreadsheetNew("SampleData") // add rows from query spreadsheetAddRows(theSheet,art) // writeOutput(theFile) // Define the structure for formatting a cell myFormat=StructNew(); myFormat.color="blue"; myFormat.bold="true"; myFormat.underline="true"; myFormat.alignment="center"; myFormat.rotation=45; myFormat.italic="true" // Set formatting to cell (10,5) SpreadsheetFormatCell(theSheet,myFormat,10,4) // clear the format spreadsheetClearCell(theSheet,10,4) spreadsheetWrite(theSheet,theFile,"yes") </cfscript>