I\'m trying to detect clicked hyperlinks in Excel. The Application.SheetFollowHyperlink Event claims that it will be called \"when you click any hyperlink in Microsoft Excel.\"<
I seem to have solved the issue, although I'm not sure why the following works while the code I used above doesn't:
Private HyperlinkFollower As Excel.DocEvents_FollowHyperlinkEventHandler
Private Sub CalledWhenHyperlinkClicked(ByVal Target As Excel.Hyperlink)
Dim w As Microsoft.Office.Interop.Excel.Window = Globals.ThisAddIn.Application.ActiveWindow
MsgBox("hyperlink clicked")
End Sub
EventDel_HyperlinkFollower = New Excel.DocEvents_FollowHyperlinkEventHandler(AddressOf CalledWhenHyperlinkClicked)
AddHandler worksheet.FollowHyperlink, EventDel_HyperlinkFollower