Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Hyperlink Excel2000 vs Excel2002

The following code is used in an Excel Macro and when ran in Excel2000
creates a valid hyperlink but in Excel2002 it does not.

ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
"\\S10AC52B\Eng\SCN\" & SCNFile, TextToDisplay:= _
"" & SCNNumber

When SCNFile is set equal to "3PH-04011.xls" the hyperlink url that's
created in Excel2000 looks like " \\S10AC52B\Eng\SCN\3PH-04011.xls" but when
created in Excel2002 it looks like "..\..\Eng\SCN\3PH-04011.xls"

Anyone have an idea as to why excel would change the url? How can I make it
work correctly?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Hyperlink Excel2000 vs Excel2002

Have you tried creating the hyperlink by inserting a "=HYPERLINK(...)"
formula into the cell ?

sURL = "\\S10AC52B\Eng\SCN\" & SCNFile
sText = SCNNumber
selection.formula = "=HYPERLINK(" & sURL & "," & sText & ")"

Tim.


"Darrell Wesley" wrote in message
...
The following code is used in an Excel Macro and when ran in Excel2000
creates a valid hyperlink but in Excel2002 it does not.

ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
"\\S10AC52B\Eng\SCN\" & SCNFile, TextToDisplay:= _
"" & SCNNumber

When SCNFile is set equal to "3PH-04011.xls" the hyperlink url that's
created in Excel2000 looks like " \\S10AC52B\Eng\SCN\3PH-04011.xls" but

when
created in Excel2002 it looks like "..\..\Eng\SCN\3PH-04011.xls"

Anyone have an idea as to why excel would change the url? How can I make

it
work correctly?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Hyperlink Excel2000 vs Excel2002

Tim,

Tried this and I get a "Application or User defined error" thrown at me when
it hits the Selection.Formula line

Looking at what this looks like when done manually:
=HYPERLINK("\\s10ac52b\eng\scn\3ph-0412","3PH-0413")
I may have to place some quote marks into it.


"Tim Williams" wrote:

Have you tried creating the hyperlink by inserting a "=HYPERLINK(...)"
formula into the cell ?

sURL = "\\S10AC52B\Eng\SCN\" & SCNFile
sText = SCNNumber
selection.formula = "=HYPERLINK(" & sURL & "," & sText & ")"

Tim.


"Darrell Wesley" wrote in message
...
The following code is used in an Excel Macro and when ran in Excel2000
creates a valid hyperlink but in Excel2002 it does not.

ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
"\\S10AC52B\Eng\SCN\" & SCNFile, TextToDisplay:= _
"" & SCNNumber

When SCNFile is set equal to "3PH-04011.xls" the hyperlink url that's
created in Excel2000 looks like " \\S10AC52B\Eng\SCN\3PH-04011.xls" but

when
created in Excel2002 it looks like "..\..\Eng\SCN\3PH-04011.xls"

Anyone have an idea as to why excel would change the url? How can I make

it
work correctly?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Hyperlink Excel2000 vs Excel2002

Changing this to
selection.formula = "=HYPERLINK(""" & sURL & """,""" & sText & """)"
allows this formula to be inserted and it at least works on my Excel2000.
Will be trying it soon on a Excel2002 version.


"Tim Williams" wrote:

Have you tried creating the hyperlink by inserting a "=HYPERLINK(...)"
formula into the cell ?

sURL = "\\S10AC52B\Eng\SCN\" & SCNFile
sText = SCNNumber
selection.formula = "=HYPERLINK(" & sURL & "," & sText & ")"

Tim.


"Darrell Wesley" wrote in message
...
The following code is used in an Excel Macro and when ran in Excel2000
creates a valid hyperlink but in Excel2002 it does not.

ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
"\\S10AC52B\Eng\SCN\" & SCNFile, TextToDisplay:= _
"" & SCNNumber

When SCNFile is set equal to "3PH-04011.xls" the hyperlink url that's
created in Excel2000 looks like " \\S10AC52B\Eng\SCN\3PH-04011.xls" but

when
created in Excel2002 it looks like "..\..\Eng\SCN\3PH-04011.xls"

Anyone have an idea as to why excel would change the url? How can I make

it
work correctly?




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Hyperlink Excel2000 vs Excel2002

Yep - always happens when I don't test before posting..

Good luck with the 2002..

Tim


"Darrell Wesley" wrote in message
...
Changing this to
selection.formula = "=HYPERLINK(""" & sURL & """,""" & sText & """)"
allows this formula to be inserted and it at least works on my Excel2000.
Will be trying it soon on a Excel2002 version.






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Hyperlink Excel2000 vs Excel2002

Tim,

Just to let you know it worked just fine with 2002.


"Tim Williams" wrote:

Yep - always happens when I don't test before posting..

Good luck with the 2002..

Tim


"Darrell Wesley" wrote in message
...
Changing this to
selection.formula = "=HYPERLINK(""" & sURL & """,""" & sText & """)"
allows this formula to be inserted and it at least works on my Excel2000.
Will be trying it soon on a Excel2002 version.





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel2002 JWD Setting up and Configuration of Excel 0 November 9th 09 03:55 PM
Text book Excel2002 VBA octet Excel Discussion (Misc queries) 1 May 22nd 09 12:02 PM
HYPERLINK URL PROBLEM (Excel2000 VS Excel2002) Darrell Wesley[_2_] Excel Programming 0 January 6th 05 08:49 PM
VBA and comments in Excel2002 Neil Garrard Excel Programming 2 February 25th 04 12:50 PM


All times are GMT +1. The time now is 04:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"