Hyperlink programing question

S

SJW_OST

I have seen this done before in the past, like 4 years ago with Excel95, but
every attempt I have made to recreate this has failed. Please help.
I want to use a cell to enter my hyperlink location such as C:\Myfile or
www.google.com.
Now I want VB to look at the cell, lets say cell A1 has this hyperlink in
it, and perform the ActiveWorkbook.FollowHyperlink Address command to open
Windows Explorer, or Internet Explorer, to that location.
How do I get VB to follow a hyperlink that has been entered in a cell anf
then, if needed, opening the appropriate program like Windows Explorer or
Internet Explorer? Or could it be a different command?
 
R

Robert Gelbmann

Hi Stranger! (How about a real name?)

---"SJW_OST said:
I have seen this done before in the past, like 4 years ago with
Excel95, but
[...]
How do I get VB to follow a hyperlink that has been entered in a cell
anf
then, if needed, opening the appropriate program like Windows
Explorer or
Internet Explorer? Or could it be a different command?

(1) Hyperlinks have been introduced with Office 97?!

(2) Try something like this:

Range("A1").Hyperlinks(1).Follow


Greetings from Vienna, Austria,
-Robert Gelbmann-
 
S

SJW_OST

Well hello there buddy! Hope you are doing well.
Thanks for the Excel history lesson. As I mentioned, it has been a while
sense I saw this done so my Excel version, obviously, was off. Sorry 'bout
that.

When I try your solution, I keep getting Run-time error '9': Subscript out
of range.

I have entered H:\ in cell A1 on Sheet1.
I then went into VB Editor and entered;

Sub A()
Range("A1").Hyperlinks(1).Follow
End Sub

Is there something I am doing incorrectly? Have I missed something?

Oh yea, my name is Stephen :)


Robert Gelbmann said:
Hi Stranger! (How about a real name?)

---"SJW_OST said:
I have seen this done before in the past, like 4 years ago with
Excel95, but
[...]
How do I get VB to follow a hyperlink that has been entered in a cell
anf
then, if needed, opening the appropriate program like Windows
Explorer or
Internet Explorer? Or could it be a different command?

(1) Hyperlinks have been introduced with Office 97?!

(2) Try something like this:

Range("A1").Hyperlinks(1).Follow


Greetings from Vienna, Austria,
-Robert Gelbmann-
 
S

SJW_OST

Ok, so I am a 'RON. I didn't enter the "hyperlink" I just typed H:\ into cell
A1. Once I entered H:\ as a hyperlink, your code worked like I wanted.

Thank you :)

SJW_OST said:
Well hello there buddy! Hope you are doing well.
Thanks for the Excel history lesson. As I mentioned, it has been a while
sense I saw this done so my Excel version, obviously, was off. Sorry 'bout
that.

When I try your solution, I keep getting Run-time error '9': Subscript out
of range.

I have entered H:\ in cell A1 on Sheet1.
I then went into VB Editor and entered;

Sub A()
Range("A1").Hyperlinks(1).Follow
End Sub

Is there something I am doing incorrectly? Have I missed something?

Oh yea, my name is Stephen :)


Robert Gelbmann said:
Hi Stranger! (How about a real name?)

---"SJW_OST said:
I have seen this done before in the past, like 4 years ago with
Excel95, but
[...]
How do I get VB to follow a hyperlink that has been entered in a cell
anf
then, if needed, opening the appropriate program like Windows
Explorer or
Internet Explorer? Or could it be a different command?

(1) Hyperlinks have been introduced with Office 97?!

(2) Try something like this:

Range("A1").Hyperlinks(1).Follow


Greetings from Vienna, Austria,
-Robert Gelbmann-
 
S

SJW_OST

Now that I have this down, I think, how can I use a hyperlink in this fashion
as a save location?

Thanks for your help,
Stephen

SJW_OST said:
Ok, so I am a 'RON. I didn't enter the "hyperlink" I just typed H:\ into cell
A1. Once I entered H:\ as a hyperlink, your code worked like I wanted.

Thank you :)

SJW_OST said:
Well hello there buddy! Hope you are doing well.
Thanks for the Excel history lesson. As I mentioned, it has been a while
sense I saw this done so my Excel version, obviously, was off. Sorry 'bout
that.

When I try your solution, I keep getting Run-time error '9': Subscript out
of range.

I have entered H:\ in cell A1 on Sheet1.
I then went into VB Editor and entered;

Sub A()
Range("A1").Hyperlinks(1).Follow
End Sub

Is there something I am doing incorrectly? Have I missed something?

Oh yea, my name is Stephen :)


Robert Gelbmann said:
Hi Stranger! (How about a real name?)

I have seen this done before in the past, like 4 years ago with
Excel95, but
[...]
How do I get VB to follow a hyperlink that has been entered in a cell
anf
then, if needed, opening the appropriate program like Windows
Explorer or
Internet Explorer? Or could it be a different command?

(1) Hyperlinks have been introduced with Office 97?!

(2) Try something like this:

Range("A1").Hyperlinks(1).Follow


Greetings from Vienna, Austria,
-Robert Gelbmann-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top