Last updated on
Feb 25, 2025
Description
Retrieves all hyperlinks, in a spreadsheet, created using the spreadsheetSetCellHyperlink function.
Returns
An array of structs containing the address, column, row, and type of all the hyperlinks.
History
ColdFusion (2025 release): Added the function.
Syntax
spreadsheetGetHyperlinks(spreadsheetObject)
spreadsheetGetHyperlinks(spreadsheetObject)
spreadsheetGetHyperlinks(spreadsheetObject)
Parameters
Name
|
Required
|
Type
|
Description
|
spreadSheetObject
|
Yes
|
ExcelInfo
|
The Excel spreadsheet object from which to retrieve the hyperlinks.
|
Example
<cfquery name="art" datasource="cfartgallery">
SELECT * FROM ART
</cfquery>
<cfscript>
theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) & "art-hyperlinks.xls";
// create a spreadsheet object
theSheet=spreadsheetNew("SampleData")
// add rows from query
spreadsheetAddRows(theSheet,art)
// add three hyperlinks
// hyperlink struct
hStruct1={
row:3,
column:3,
address: "https://www.adobe.com",
type:"URL"
}
// set hyperlink on cell 3,3
spreadsheetSetCellHyperlink(theSheet,hStruct1)
// second hyperlink
hStruct2={
row:4,
column:3,
address: "https://www.google.com",
type:"URL"
}
// set hyperlink on cell 4,3
spreadsheetSetCellHyperlink(theSheet,hStruct2)
// third hyperlink
hStruct3={
row:5,
column:3,
address: "https://www.apple.com",
type:"URL"
}
// set hyperlink on cell 5,3
spreadsheetSetCellHyperlink(theSheet,hStruct3)
// write the spreadsheet
spreadsheetWrite(theSheet,theFile,"yes")
// get all the hyperlinks
listOfHyperlinks=spreadsheetGetHyperlinks(theSheet)
writeDump(listOfHyperlinks)
</cfscript>
<cfquery name="art" datasource="cfartgallery">
SELECT * FROM ART
</cfquery>
<cfscript>
theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) & "art-hyperlinks.xls";
// create a spreadsheet object
theSheet=spreadsheetNew("SampleData")
// add rows from query
spreadsheetAddRows(theSheet,art)
// add three hyperlinks
// hyperlink struct
hStruct1={
row:3,
column:3,
address: "https://www.adobe.com",
type:"URL"
}
// set hyperlink on cell 3,3
spreadsheetSetCellHyperlink(theSheet,hStruct1)
// second hyperlink
hStruct2={
row:4,
column:3,
address: "https://www.google.com",
type:"URL"
}
// set hyperlink on cell 4,3
spreadsheetSetCellHyperlink(theSheet,hStruct2)
// third hyperlink
hStruct3={
row:5,
column:3,
address: "https://www.apple.com",
type:"URL"
}
// set hyperlink on cell 5,3
spreadsheetSetCellHyperlink(theSheet,hStruct3)
// write the spreadsheet
spreadsheetWrite(theSheet,theFile,"yes")
// get all the hyperlinks
listOfHyperlinks=spreadsheetGetHyperlinks(theSheet)
writeDump(listOfHyperlinks)
</cfscript>
<cfquery name="art" datasource="cfartgallery"> SELECT * FROM ART </cfquery> <cfscript> theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) & "art-hyperlinks.xls"; // create a spreadsheet object theSheet=spreadsheetNew("SampleData") // add rows from query spreadsheetAddRows(theSheet,art) // add three hyperlinks // hyperlink struct hStruct1={ row:3, column:3, address: "https://www.adobe.com", type:"URL" } // set hyperlink on cell 3,3 spreadsheetSetCellHyperlink(theSheet,hStruct1) // second hyperlink hStruct2={ row:4, column:3, address: "https://www.google.com", type:"URL" } // set hyperlink on cell 4,3 spreadsheetSetCellHyperlink(theSheet,hStruct2) // third hyperlink hStruct3={ row:5, column:3, address: "https://www.apple.com", type:"URL" } // set hyperlink on cell 5,3 spreadsheetSetCellHyperlink(theSheet,hStruct3) // write the spreadsheet spreadsheetWrite(theSheet,theFile,"yes") // get all the hyperlinks listOfHyperlinks=spreadsheetGetHyperlinks(theSheet) writeDump(listOfHyperlinks) </cfscript>