Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a hyperlink for a excel sheet: xlsxwriter

Is it possible to create a hyperlink for a specific sheet of an excel file?

I want to open a sheet on the click of a cell which is on another sheet of the same excel file. For example, if someone clicks on 'A1' cell which is in the sheet2 the sheet1 will be opened and both the sheets are in the abc.xlsx file.

like image 321
bSr Avatar asked May 16 '18 11:05

bSr


2 Answers

You can do this with the XlsxWriter Worksheet write_url() method using the internal: URI. See the XlsxWriter docs on write_url().

like image 200
jmcnamara Avatar answered Oct 17 '22 04:10

jmcnamara


I was unable to get this to work using the "write_url(A1, "internal:'sheet name'!A2")" form. Can someone provide some guidance on this?

I was able to successfully add hyperlinks to internal cells using the form:

write('A1', '=HYPERLINK(CELL("address", 'sheet name'!A2), "Friendly Name")

NOTE: the word 'address' is literal/not a generic reference, and, the quotes need to be specified as shown (i.e., single quotes for a multi-word sheet name, and double quotes for the word 'address' and the 'Friendly Name'...

like image 32
Seeking Guidance Avatar answered Oct 17 '22 03:10

Seeking Guidance