I use the following code to read in an Excel file and export select sheets to a PDF:
import win32com.client
xlsx_path = "" #insert path to excel file
pdf_path = "" #insert path to pdf output
excel = win32com.client.gencache.EnsureDispatch("Excel.Application")
wb = excel.Workbooks.Open(xlsx_path)
sheet_list = ["Sheet1", "Sheet2"]
wb.Worksheets(sheet_list).Select()
wb.ActiveSheet.ExportAsFixedFormat(0, pdf_path)
wb.Close()
Within the Excel file I have hyperlinks that toggle between the sheets, but the links loose their functionality in PDF format. An example of the macro I use is:
=HYPERLINK("[file.xlsx]Sheet1!A1","back")
My question is if there is any way to preserve the links functionality in PDF form?