-
-
Notifications
You must be signed in to change notification settings - Fork 36
setCellHyperLink
Julian Halliwell edited this page Mar 3, 2023
·
5 revisions
Adds a hyperlink to a cell. If the cell doesn't exist it will be created.
setCellHyperLink( workbook, link, row, column[, cellValue[, type,[ format,[ tooltip ] ] ] ] )
-
workbook
spreadsheet object -
link
string: the URL or target of the hyperlink -
row
numeric -
column
numeric
-
cellValue
any value to set in the cell which will be hyperlinked -
type
string default="URL": the type of hyperlink. Possible values:URL
,Email
,File
(local file),Document
(i.e. another part of the spreadsheet) -
format
struct OR cellStyle object default={ color: "BLUE", underline: true }
: See formatting options -
tooltip
string: Text to appear when hovering over the hyperlink (NB: XLSX only and may not be supported by all spreadsheet software)
Chainable? Yes.
spreadsheet = New spreadsheet();
workbook = spreadsheet.new();
spreadsheet.setCellHyperLink( workbook, "https://github.com/", 1, 1 );
spreadsheet = New spreadsheet();
workbook = spreadsheet.new();
spreadsheet.setCellHyperLink( workbook, "anotherSpreadsheet.xls", 1, 1 );
spreadsheet = New spreadsheet();
workbook = spreadsheet.new();
spreadsheet.setCellValue( workbook, "Please link to me", 1, 1 );
spreadsheet.setCellHyperLink( workbook, "'Sheet1'!A1", 2, 1, "OK I will" );