Last updated on
Feb 25, 2025
Description
Adds a hyperlink on a specific cell in a spreadsheet.
Returns
None
History
ColdFusion (2025 release): Added the function.
Syntax
spreadsheetSetCellHyperlink(spreadsheetObject,row,column)
Parameters
Name
|
Required
|
Type
|
Description
|
spreadSheetObject
|
Yes
|
ExcelInfo
|
The Excel spreadsheet object for which to set the hyperlink on a cell.
|
hyperlinkInfo
|
Yes
|
Struct
|
A struct with the following keys:
|
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) // hyperlink struct hStruct={ row:1, column:4, address: "https://www.adobe.com", type:"URL" } // set hyperlink on cell 11,4 spreadsheetSetCellHyperlink(theSheet,hStruct) spreadsheetWrite(theSheet,theFile,"yes") getHyperLink=spreadsheetGetCellHyperlink(theSheet,1,4) //getHyperLink=spreadsheetGetCellHyperlink(theSheet,hStruct) writeDump(getHyperLink) </cfscript>