I want to add an hyperlink to a cell of another workbook. I am able to refer the whole file but I have issues when referring an specific cell.
The generated hyperlink is well formed because when I click on modify hyperlink and then OK (without modifying it) on the generated Excel file then the hyperlink starts to work.
I have already tried with all the constructors of Uri, I tried to calculate the cell value but I don't find the solution. Here's my code.
This works:
resultSheet.Cells[currentRow, 10].Hyperlink = new Uri(message.myReference.filePath, UriKind.Absolute);
This doesn't work until clicking on modify and then ok on the generated Excel file.
resultSheet.Cells[currentRow, 10].Hyperlink = new Uri(message.myReference.filePath + "#'" + message.myReference.sheetName + "'!" + "A" + message.myReference.cellRow, UriKind.Absolute);
I would really appreciate any kind of help because I'm kinda stuck on this silly issue.