Can anybody tell me how we can add a hyperlink in Excel (2007 or later) from a cell in one sheet to a cell in another sheet using Office Interop in .NET (c#)
For example: A hyperlink from Sheet1 Cell A1 to Sheet2 Cell B10
Can anybody tell me how we can add a hyperlink in Excel (2007 or later) from a cell in one sheet to a cell in another sheet using Office Interop in .NET (c#) For example: A hyperlink from Sheet1 Cell A1 to Sheet2 Cell B10 |
||||
|
What you want to use here is the Hyperlinks.Add method. You can call it with code that looks something like this:
Here is a full automation example that you can test:
Hope this helps! Mike |
|||
|
I do it so:
It is important to insert the symbol # in the link that leads to a cell inside the book, if this symbol is not inserted, then the link is broken. I described this decision in an article in Russian language, an example can be found here |
|||
|