P
Peter Holschbach
Hi,
I have a Excel document where I want to add a hyper link to other Excel
documents with a relativ path name.
Example:
.\Test Excel\2.4 Funktion\11_Test.xls
I add this link
....
string relPath = ".\Test Excel\2.4 Funktion\11_Test.xls";
Microsoft.Office.Interop.Excel.Range range = ResultSheet.get_Range("A" +
Row.ToString(), Missing.Value);
range.Hyperlinks.Add(range, relPath, Missing.Value, Missing.Value, relPath);
....
In Excel I can see the text ".\Test Excel\2.4 Funktion\11_Test.xls" in the
cell, it is blue marked as a hyperlink but it didn't work as hyperlink. If I
start editing this hyperlink in Excel, I only see a empty URL.
Next step was replace all spaces by %20 and all "\" by "/"
.....
string relPath = ".\Test Excel\2.4 Funktion\11_Test.xls";
string relLink = relPath.Replace('\\', '/').Replace(" ","%20");
Microsoft.Office.Interop.Excel.Range range = ResultSheet.get_Range("A" +
Row.ToString(), Missing.Value);
range.Hyperlinks.Add(range, relLink , Missing.Value, Missing.Value,
relPath);
.....
no difference, the cell is shown with blue text, but the link is not
working.
Any idea ?
thanx
Peter
I have a Excel document where I want to add a hyper link to other Excel
documents with a relativ path name.
Example:
.\Test Excel\2.4 Funktion\11_Test.xls
I add this link
....
string relPath = ".\Test Excel\2.4 Funktion\11_Test.xls";
Microsoft.Office.Interop.Excel.Range range = ResultSheet.get_Range("A" +
Row.ToString(), Missing.Value);
range.Hyperlinks.Add(range, relPath, Missing.Value, Missing.Value, relPath);
....
In Excel I can see the text ".\Test Excel\2.4 Funktion\11_Test.xls" in the
cell, it is blue marked as a hyperlink but it didn't work as hyperlink. If I
start editing this hyperlink in Excel, I only see a empty URL.
Next step was replace all spaces by %20 and all "\" by "/"
.....
string relPath = ".\Test Excel\2.4 Funktion\11_Test.xls";
string relLink = relPath.Replace('\\', '/').Replace(" ","%20");
Microsoft.Office.Interop.Excel.Range range = ResultSheet.get_Range("A" +
Row.ToString(), Missing.Value);
range.Hyperlinks.Add(range, relLink , Missing.Value, Missing.Value,
relPath);
.....
no difference, the cell is shown with blue text, but the link is not
working.
Any idea ?
thanx
Peter