Whatever message this page gives is out now! Go check it out!

spreadsheetSetActiveCell

Last update:
May 18, 2026

Description

Sets a specified cell as active.

Returns

None

History

  • ColdFusion (2025 release): Added the function.

Syntax

spreadsheetSetActiveCell(spreadsheetObject,row,column)

Parameters

Name
Required
Type
Description
spreadSheetObject
Yes
ExcelInfo
The Excel spreadsheet object on which to set a cell as active.
row
Yes
Integer
The row number of the cell.
column
Yes
Integer
The column number of the cell.

Example

<cfquery name="art" datasource="cfartgallery">
    SELECT * FROM ART
</cfquery>
<cfscript>
    theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) & "art.xls";
    // create a spreadsheet object
    theSheet=spreadsheetNew("SampleData")
    // add rows from query
    spreadsheetAddRows(theSheet,art)
    // set active cell 1,6
    spreadsheetSetActiveCell(theSheet,10,6)
    spreadsheetWrite(theSheet,theFile,"yes")
    infoActiveCell=spreadsheetGetActiveCell(theSheet)
    writeDump(infoActiveCell)
</cfscript>

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page