Hi,
is it possible to add a hyperlink to a cell that refers to another worksheet in the same workbook using the excelexporter? I'm generating an excelworkbook that contains about 10 - 20 sheets. Now I want to add an "index sheet" to the workbook from which you can jump top the different sheets.
Regarding this i have another question is it possible to add a sheet to a workbook at a predefined position? What I mean is that I wnat to insert a worksheet and not to add (always last position).
Thank you
Michael
Michael Oppitz said:is it possible to add a hyperlink to a cell that refers to another worksheet in the same workbook using the excelexporter? I'm generating an excelworkbook that contains about 10 - 20 sheets. Now I want to add an "index sheet" to the workbook from which you can jump top the different sheets.
Excel allows adding hyperlinks through two ways. The first is directly typing the hyperlink in the cell. It is then auto-converted and special information is written out with the file to indicate the cell has a hyperlink. However, our Excel assembly does not support this. The other way is to set a formula on the cell using the HYPERLINK function, such as =HYPERLINK("http://es.infragistics.com"). You could do this by using the ApplyFormula method on the cell. That being said, I have never tried hyperlinking to a specific worksheet in Excel. I'm curious to know what the syntax of the link looks like. If it doesn't work using the HYPERLINK function, you can submit a feature request to support the other hyperlink style: http://devcenter.infragistics.com/Protected/RequestFeature.aspx.
Michael Oppitz said:Regarding this i have another question is it possible to add a sheet to a workbook at a predefined position? What I mean is that I wnat to insert a worksheet and not to add (always last position).
This is not currently supported. You can also submit a feature request for this at the link above.
Thank you for your help. Applying the formula worked - but it wasn't so easy to define a dynamic link that also works when the location and filename of the workbook changes.
=HYPERLINK(MID(CELL("filename",A1),FIND("[",CELL("filename",A1)),(FIND("]",CELL("filename",A1))+1)-FIND("[",CELL("filename",A1))) & "'Sheets2'!B1","Details")
Cheers,
Hi praveen2660,
you have to add the formula to the cell using the "ApplyFormula"-Method. In your caseWorksheet.Cells(0).ApplyFormula("=HYPERLINK(""c:\test\Doc1.doc"",""TEXT"")")
Hope this helps!
This sounds like a bug. I would recommend submitting the issue to the support group: http://es.infragistics.com/gethelp.
Hi Michael,
This is my formula : =HYPERLINK("c:\test\Doc1.doc","TEXT")
In excel it is displaying as =HYPERLINK("c:\test\Doc1.doc","TEXT") ,But Hyperlink is not coming, I have to enter "Press Enter key"on every cell to get hyperlink.I want to dispaly hyperlink when ever I open excel,Please help me.