We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Fail to create an hyperlink to a cell in other sheet


I’m trying without success to add an hyperlilnk that will direct to other sheet.
This is my code:

ReportSheet.Hyperlinks.Add(“B1”, 1, 1, workBook.Worksheets[0].Name + “!A1”);

Could you please advise what am i missing?


Well, it works fine. Here is my complete code and attached is the output file. I am using latest version v7.0.1.x.

Sample code:
//Instantiating a Workbook object
Workbook workbook = new Workbook();

//Obtaining the reference of the first (default) worksheet
Worksheet worksheet = workbook.Worksheets[0];
//Add a second sheet
Worksheet sheet2 = workbook.Worksheets.Add(“Sheet2”);

//Adding an internal hyperlink to the “B9” cell of the other worksheet “Sheet2” in
//the same Excel file
worksheet.Hyperlinks.Add(“B3”, 1, 1, “Sheet2!B9”);

//Saving the Excel file

Thank you.