Nitricpyro
New Member
- Joined
- Apr 11, 2013
- Messages
- 3
I have two lines of code that create hyperlinks from within my macro. However, I'm curious why there is such a huge difference in the output... can anyone help me understand what is going on to make these two different?
METHOD 1
USE: ActiveCell.Formula = "=HYPERLINK(""" & fullPath & """,""" & friendlyName & """)"
OUTPUT: In cell "=HYPERLINK("\\afakepathname\etc\","VIEW GRAPH")" and displays "VIEW GRAPH"
HYPERLINK: Works and takes me to \\afakepathname\etc\
METHOD 2
USE: ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="" & CStr(fullPath), TextToDisplay:="VIEW GRAPH"
OUTPUT: In cell "VIEW GRAPH" only, does not show the formula etc.
HYPERLINK: Does not work and shows something like "..\..\..\..\..\..\..\Other Directory Info\afakepathname\etc\"
Why do the outputs change so much? Even forcing the address to a string it still adjusts it.
METHOD 1
USE: ActiveCell.Formula = "=HYPERLINK(""" & fullPath & """,""" & friendlyName & """)"
OUTPUT: In cell "=HYPERLINK("\\afakepathname\etc\","VIEW GRAPH")" and displays "VIEW GRAPH"
HYPERLINK: Works and takes me to \\afakepathname\etc\
METHOD 2
USE: ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="" & CStr(fullPath), TextToDisplay:="VIEW GRAPH"
OUTPUT: In cell "VIEW GRAPH" only, does not show the formula etc.
HYPERLINK: Does not work and shows something like "..\..\..\..\..\..\..\Other Directory Info\afakepathname\etc\"
Why do the outputs change so much? Even forcing the address to a string it still adjusts it.