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

I am trying to do what I assume would be simple. I want to initiate some
code when a hyperlink is clicked. I have put to following code in Sheet1,
which has the hyperlink(s).

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Sheets("Sheet1").Range("B1") = "It Ran"
End Sub

The hyperlink runs, but never runs the code. I am running Excel 2007.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Hyperlink events

In the immediate window type this and try again
APplication.EnableEvents = True
--
HTH,

Barb Reinhardt



"ZipCurs" wrote:

I am trying to do what I assume would be simple. I want to initiate some
code when a hyperlink is clicked. I have put to following code in Sheet1,
which has the hyperlink(s).

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Sheets("Sheet1").Range("B1") = "It Ran"
End Sub

The hyperlink runs, but never runs the code. I am running Excel 2007.

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

Hello Barb,

Thank you for the quick response. I definitely have the events enabled. I
substituted the following code and it worked fine:

Sub Worksheet_SelectionChange(ByVal Target As Range)
If ActiveCell.Address = "$B$12" Then
Sheets("Sheet1").Range("B1") = "It Ran"
End If
End Sub

The problem seems to be linked to the HyperLink event, which does not run.
Any clues? I eventually plan on putting the code into a workbook with plenty
of other events, so I would prefer to keep the response focused on HyperLink
activation.

"Barb Reinhardt" wrote:

In the immediate window type this and try again
APplication.EnableEvents = True
--
HTH,

Barb Reinhardt



"ZipCurs" wrote:

I am trying to do what I assume would be simple. I want to initiate some
code when a hyperlink is clicked. I have put to following code in Sheet1,
which has the hyperlink(s).

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Sheets("Sheet1").Range("B1") = "It Ran"
End Sub

The hyperlink runs, but never runs the code. I am running Excel 2007.

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
Can't make hyperlink function work for hyperlink to website Frank B Denman Excel Worksheet Functions 15 February 5th 07 11:01 PM
do events? background events cereldine[_15_] Excel Programming 1 April 12th 06 01:06 PM
Intra-workbook hyperlink: macro/function to return to hyperlink ce marika1981 Excel Discussion (Misc queries) 3 May 6th 05 05:47 AM
reading html when hyperlink address not hyperlink text diplayed Kevin Excel Programming 1 December 4th 03 10:13 PM
Hyperlink events Ignatius[_2_] Excel Programming 1 August 12th 03 02:59 AM


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

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"