title: Excel, ThisAddIn.vb: why is Application.SheetFollowHyperlink not called for =HYPERLINK()
body: <p>I'm trying to detect clicked hyperlinks in Excel. The Application.SheetFollowHyperlink Event <a href="http://msdn.microsoft.com/en-us/library/office/ff821956.aspx" rel="nofollow">claims</a> that it will be called "when you click any hyperlink in Microsoft Excel."</p>
  
  <p>However, although it does fire when a cell contains a url like <code>www.google.com</code>, it does not when the cell contains <code>=HYPERLINK("http://www.google.com", "google")</code>.</p>
  
  <p>How do I detect clicks to the second type of hyperlink? </p>
  
  <hr>
  
  <p>For example, a simple excel add in:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>A message box containing "Hyperlink Clicked" will appear when you click a cell containing <code>www.google.com</code> but not a cell containing <code>=HYPERLINK("http://www.google.com", "google")</code>.</p>