You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by "Khator, Bhavesh (IT)" <Bh...@morganstanley.com> on 2006/05/25 19:14:41 UTC
Creating hyperlink in Excel using POI
Hi All,
Just trying to figure out how to put a hyperlink in an excel sheet,
target of which is another sheet in the same workbook.
I am trying to do the following:
c = r.createCell((short)2);
c.setCellType(HSSFCell.CELL_TYPE_FORMULA);
c.setCellStyle(cs);
String formula="HYPERLINK(\"Revised Actions Sublevels I-II!A2\",
\"Click Here to go to Revised Actions Sheet\")";
c.setCellFormula(formula);
//Revised Actions Sublevels I-II is the sheet in the same workbook
But this doesn't seem to work. The error message I get is "Cannot open
the specified file". I know it could be a small mistake in the way the
formula is created, but any help would be appreciated.
The following is from MS Excel Help, but this doesnt seem to work even
in a normal sheet and gives the same error.
You can create hyperlinks within a worksheet to jump from one cell to
another cell. For example, if the active worksheet is the sheet named
June in the workbook named Budget, the following formula creates a
hyperlink to cell E56. The link text itself is the value in cell E56.
=HYPERLINK("[Budget]June!E56", E56)
To jump to a different sheet in the same workbook, change the name of
the sheet in the link. In the previous example, to create a link to cell
E56 on the September sheet, change the word "June" to "September."
Regards,
Bhavesh
--------------------------------------------------------
NOTICE: If received in error, please destroy and notify sender. Sender does not waive confidentiality or privilege, and use is prohibited.