我正在尝试检测 Excel 中单击的超链接。Application.SheetFollowHyperlink 事件声称“当您单击 Microsoft Excel 中的任何超链接时”将调用它。
然而,尽管当单元格包含类似 url 时它会触发,但当www.google.com
单元格包含=HYPERLINK("http://www.google.com", "google")
.
如何检测对第二种超链接的点击?
例如,一个简单的excel add in:
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")
.