我试图发现在Excel中点击的超链接。 该Application.SheetFollowHyperlink事件声称 ,这将被称为“当您单击Microsoft Excel中的任何链接。”
然而,尽管它确实火灾当单元格中包含像一个网址www.google.com
,它不是当单元格包含不=HYPERLINK("http://www.google.com", "google")
如何检测点击第二类型的超链接?
例如,一个简单的Excel中添加:
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
当您单击含有细胞会出现含有“超链接被点击的”一个消息框, www.google.com
,但不包含电池=HYPERLINK("http://www.google.com", "google")