I am trying to detect hyperlink with a hyperlink in Excel. The Application.SheetFollowHyperlink event claims that it will be called "when any hyperlink in Microsoft Excel is clicked".
However, although it fires when the cell contains a URL such as www.google.com , this does not happen when the cell contains =HYPERLINK("http://www.google.com", "google") .
How to determine clicks for the second type of hyperlink?
For example, a simple excel adds:
Public Class ThisAddIn Private Sub ThisAddIn_Startup(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Startup End Sub Private Sub ThisAddIn_Shutdown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shutdown End Sub Private Sub Application_SheetFollowHyperlink(ByVal Sh As Object, ByVal Target As Microsoft.Office.Interop.Excel.Hyperlink) Handles Application.SheetFollowHyperlink MsgBox("Hyperlink Clicked") End Sub
A window will appear with the message "Hyperlink clicked" when you click on the cell containing www.google.com but not the cell containing =HYPERLINK("http://www.google.com", "google") .
source share