jribble
asked on
Creating a HyperLink from a cell to a worksheet using C#
I have written a C# application using VS2005.NET to generate an Excel spreadsheet. My first worksheet contains an index to the other worksheets and I want to autogenerate a HyperLink using my C# application from cells in the first worksheet to the other worksheets.
I have seen many examples of linking to a web page and have done this using something like this:
worksheet.Hyperlinks.Add(h yperLinkRa nge, "HTTP:\\www.google.com",Type.Missing, Type.Missing, "Hyperlink Test");
The problem I have is I'm not sure how to reference a worksheet in the same Excel file.
I have seen many examples of linking to a web page and have done this using something like this:
worksheet.Hyperlinks.Add(h
The problem I have is I'm not sure how to reference a worksheet in the same Excel file.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Glad it worked. Happy to be of help. :)
ASKER
Your possible solution was helpful. As it turns out I was missing the apostrophes. Here is the line of code that worked for me:
indexWorksheet.Hyperlinks.
Thanks,
Joe