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

spreadsheetSetCellHyperlink

Last update:
May 18, 2026

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:
  • row: The row number of the cell.
  • column: the column number of the cell.
  • address: the url to redirect.
  • type: valid values are url, email, or document.

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>

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