Hyperlinks to navigate between worksheets don't work after converting to PDF

Hey!

I’m referring to this gembox page right here → Add Hyperlinks to Excel Cells in C# and VB.NET | GemBox.Spreadsheet Example

I have the same code but instead of having the location as a cell inside the same worksheet, I’m using a cell of a different worksheet as the location.
It works just fine in Excel, but when I try to convert to PDF using GemBox, it becomes not clickable anymore.

I tried to use a hyperlink formula along with the Calculate method, it didn’t work too.

Here’s my code:

SpreadsheetInfo.SetLicense("FREE-LIMITED-KEY");

var workbook = new ExcelFile();
var worksheet = workbook.Worksheets.Add("Hyperlinks");
var secondWorksheet = workbook.Worksheets.Add("SecondWorksheet");
var hyperlinkStyle = workbook.Styles[BuiltInCellStyleName.Hyperlink];

var cell = worksheet.Cells["B3"];
cell.Value = "Jump";
cell.Style = hyperlinkStyle;
cell.Hyperlink.ToolTip = "This is tool tip! This hyperlink jumps to E1.";
cell.Hyperlink.Location = secondWorksheet.Name + "!E3";

workbook.Calculate();

Link to download the excel file generated by the code above: Hyperlinks.xlsx - Google Sheets

Link to download the PDF I got after converting that Excel file: (It’s allowed only two links)

Please let me know if you guys need any further information.
Thanks in advance!

Here’s the link to the PDF file → HyperlinksPDF.pdf - Google Drive

Hi Johann,

The problem occurs when the destination cell (in your case cell ‘E3’ from the second sheet) is missing in the output PDF. So, please try making sure that the second sheet is not empty and that the cell ‘E3’ is inside the cell range that is exported to PDF.

Last, we did notice an issue when that destination cell is empty, but we resolved that problem with this latest NuGet package:

Install-Package GemBox.Spreadsheet -Version 49.0.1427-hotfix

I hope this helps, let me know if you need anything else.

Regards,
Mario

That’s it Mario, the destination cell can’t be empty.

Thank you!!