Free Support Forum -

Hyperlink not working in v.

I get a "reference is not valid" when I try to click the link it created to another file. I used the code take from you Wiki here:

Also, the target file does exist.

I have attached a screenshot of the error.


//Instantiating an Excel object
Excel excel=new Excel();

//Adding a new worksheet to the Excel object

//Obtaining the reference of the newly added worksheet by passing its sheet index
Worksheet worksheet=excel.Worksheets[0];

//Adding an internal hyperlink to the "B9" cell of the other worksheet "Sheet2" in
//the same Excel file
worksheet.Hyperlinks.Add("A5", 1, 1, "C:\\book1.xls");

//NOTE: trivial but I'll state it anyway - you need to call this - probably should update your Wiki


//Saving the Excel file

Please try this attached fix. It's solved.

It worked. Thank you.