#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Hyperlink

Hello,

I have a Single hyperlink in a cell. This Hyperlink is pointing to a Folder
on the drive. What I want to know is this.
Is it possible to run a particular piece of code once I click on the
hyperlink?. It does not matter if the folder is resolved and opened but I
want to run a piece of code which check for a particular file in another
Drive Folder and opens that file(.doc) depending on some conditions.



Regards,
SSR


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 179
Default Hyperlink

SSR

You can use the Worksheet_FollowHyperlink event. You can limit when the
event runs by testing the Target argument. So if you have multiple
hyperlinks, but only want the code to run when one of them is clicked, you
can use an If statement like these

If Target.Address = "C:\My Documents\" Then

or

If Target.Range.Address = "$A$1" Then

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"Srinath" wrote in message
...
Hello,

I have a Single hyperlink in a cell. This Hyperlink is pointing to a

Folder
on the drive. What I want to know is this.
Is it possible to run a particular piece of code once I click on the
hyperlink?. It does not matter if the folder is resolved and opened but I
want to run a piece of code which check for a particular file in another
Drive Folder and opens that file(.doc) depending on some conditions.



Regards,
SSR




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Hyperlink

Hello,

Sorry I should have mentioned before I'm using Excel 97 and I cannot find
the event you mentioned.

Regards,
SSR

"Dick Kusleika" wrote in message
...
SSR

You can use the Worksheet_FollowHyperlink event. You can limit when the
event runs by testing the Target argument. So if you have multiple
hyperlinks, but only want the code to run when one of them is clicked, you
can use an If statement like these

If Target.Address = "C:\My Documents\" Then

or

If Target.Range.Address = "$A$1" Then

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"Srinath" wrote in message
...
Hello,

I have a Single hyperlink in a cell. This Hyperlink is pointing to a

Folder
on the drive. What I want to know is this.
Is it possible to run a particular piece of code once I click on the
hyperlink?. It does not matter if the folder is resolved and opened but I
want to run a piece of code which check for a particular file in another
Drive Folder and opens that file(.doc) depending on some conditions.



Regards,
SSR





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 179
Default Hyperlink

SSR

That event must have been introduced in 2000. A couple of options: You can
set up text in a cell and format it to look like a hyperlink, but it won't
really be a hyperlink. Then use the BeforeDoubleClick event. That will
have the disadvantage of not working like a true hyperlink in that you will
have to double click it instead of single click.

Another option is to add a shape from the Drawing toolbar over the cell.
You can put text in the rectangle, again formatted to look like a hyperlink,
then assign a macro to the shape which will execute when you click the
shape. You won't get the hand-cursor with either method either.

Neither of these options is very good, but I can't think of anything else.

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"Srinath" wrote in message
...
Hello,

Sorry I should have mentioned before I'm using Excel 97 and I cannot find
the event you mentioned.

Regards,
SSR

"Dick Kusleika" wrote in message
...
SSR

You can use the Worksheet_FollowHyperlink event. You can limit when the
event runs by testing the Target argument. So if you have multiple
hyperlinks, but only want the code to run when one of them is clicked, you
can use an If statement like these

If Target.Address = "C:\My Documents\" Then

or

If Target.Range.Address = "$A$1" Then

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"Srinath" wrote in message
...
Hello,

I have a Single hyperlink in a cell. This Hyperlink is pointing to a

Folder
on the drive. What I want to know is this.
Is it possible to run a particular piece of code once I click on the
hyperlink?. It does not matter if the folder is resolved and opened but

I
want to run a piece of code which check for a particular file in another
Drive Folder and opens that file(.doc) depending on some conditions.



Regards,
SSR







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
Paste Hyperlink result as working hyperlink Bod Excel Worksheet Functions 2 January 22nd 10 04:22 AM
Can't make hyperlink function work for hyperlink to website Frank B Denman Excel Worksheet Functions 15 February 5th 07 11:01 PM
How do I create a hyperlink to a cell with the hyperlink function S. Bevins Excel Worksheet Functions 2 July 20th 06 08:06 PM
Moving rows with Hyperlink doesn't move hyperlink address Samad Excel Discussion (Misc queries) 15 June 22nd 06 12:03 PM
Intra-workbook hyperlink: macro/function to return to hyperlink ce marika1981 Excel Discussion (Misc queries) 3 May 6th 05 05:47 AM


All times are GMT +1. The time now is 05:59 PM.

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

About Us

"It's about Microsoft Excel"