I have to generate an excel with summary results. The results are included in a list. Some of the elements are values and some links.
I managed to generate the excel
Try this :
sheet['A1'].hyperlink = "http://stackoverflow.com"
sheet['A1'].value="StackOverflow"
In my try this does not add the formatting that Excel puts with a hyperlink but the cell contents are more like the Excel hyperlink cell than I get with the HYPERLINK tag.
If wanting to use Excel's built in hyperlink function directly, you can use the following to format as a link:
'=HYPERLINK("{}", "{}")'.format(link, "Link Name")
e.g. ws.cell(row=1, column=1).value = '=HYPERLINK("{}", "{}")'.format(link, "Link Name")
This works for me:
wbook.active['A8'].hyperlink = "http://www.espn.com"
wbook.active['A8'].value = 'ESPN'
wbook.active['A8'].style = "Hyperlink"
This worked for me.
sheet.column_dimensions["A"].width = 30
sheet.cell(row=1, column=1).hyperlink = "http://www.espn.com"
book.save('links.xlsx')