ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   HYPERLINK URL PROBLEM (Excel2000 VS Excel2002) (https://www.excelbanter.com/excel-programming/320241-hyperlink-url-problem-excel2000-vs-excel2002.html)

Darrell Wesley[_2_]

HYPERLINK URL PROBLEM (Excel2000 VS Excel2002)
 
A macro in Excel has the following code to create a hyperlink.

Range("A" & Row).Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
"\\S10AC52B\Eng\SCN\" & SCNFile, TextToDisplay:= _
"" & SCNNumber
where the variable SCNFile is the name of the workbook like "MyBook.xls"
and SCNNumber looks like "MyBook".

The code works fine when ran in Excel 2000 and gives a valid hyperlink
address of \\S10AC52B\Eng\SCN\MyBook.xls

BUT when ran in a version of Excel 2002 the link has the address of
"..\..\Eng\SCN\MyBook.xls" which of course does not exist.

Anyone have an idea of how or why Excel changed the link address? Or how to
correct it programmatically?



All times are GMT +1. The time now is 07:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com