Free Support Forum -

Creating Hyperlinks to another worksheet with spaces in sheet name

Hello All,

I’m having an issues with creating a hyperlink to a worksheet. I followed the example here and came up with this.

Worksheet worksheet = worksheets.get(2);
String title = worksheet.getName(); // Title is “Linked Keywords”
worksheet = worksheets.get(1);
worksheet.getHyperlinks().add(“B1”, 1, 1, title+"!A1");

However when I open the workbook I get an “Reference not Valid” when I click on the link. Any help would be great.


Please refer to this document for your help.

Adding Hyperlinks to Link Data

Thank is the same link that I have from my first post. I’ve already went through the documentation and tutorial. I’m thinking it might be a bug or there is something that I am not understanding. The example from the documentation has a spreadsheet name but the name does not a space in the example. With what I( am trying to work with it does have a space in the name. Example will you get the same expected result from the following two calls:

worksheet.getHyperlinks().add(“B1”, 1, 1, “Sheet 9!A1”);

worksheet.getHyperlinks().add(“B1”, 1, 1, “Sheet9!A1”);

the first causes the link to me invalid, the second doesn’t.


For reference to sheet whose name has special
characters, please use ‘’ to quote the sheet name, such as:<o:p></o:p>

worksheet.getHyperlinks().add("B1", 1, 1, "’Sheet 9’!A1");

It is the same way that works in MS Excel too.

Thank you.