Here is a vba workaround that doesn't require adding comments to the cells and therefore the cells with the hyperlinks won't display the distracting red comment triangle.
Setting the
DisableAllHyperlinkScreenTips Property to TRUE will disable all hyperlink screenTips throughout the workbook
Setting the
DisableHyperlinkScreenTip Property to TRUE will disable only the screentiips for specific cells of your choice.
1- Code in the
ThisWorkbook Module:
Code:
Option Explicit
Private Enum Scope
IndividualHyperlinks
AllHyperlinks
End Enum
Private Type POINTAPI
x As Long
y As Long
End Type
[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=If]#If[/URL] VBA7 Then
Private Declare PtrSafe Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=Else]#Else[/URL]
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=End]#End[/URL] If
Private WithEvents oCmbrsEvents As CommandBars
Private eScope As Scope
Public Property Let DisableAllHyperlinkScreenTips(ByVal Disable As Boolean)
eScope = AllHyperlinks
If Disable Then
Set oCmbrsEvents = Application.CommandBars
oCmbrsEvents_OnUpdate
Else
Set oCmbrsEvents = Nothing
End If
End Property
Public Property Let DisableHyperlinkScreenTip(ByVal Range As Range, ByVal Disable As Boolean)
Dim oCell As Range
eScope = IndividualHyperlinks
If Disable Then
For Each oCell In Range
oCell.ID = "HyperlinkDisabled"
Next
Set oCmbrsEvents = Application.CommandBars
oCmbrsEvents_OnUpdate
Else
For Each oCell In Range
oCell.ID = ""
Next
Set oCmbrsEvents = Nothing
End If
End Property
Private Sub oCmbrsEvents_OnUpdate()
Dim tCurPos As POINTAPI
Dim oCell As Variant
GetCursorPos tCurPos
Set oCell = ActiveWindow.RangeFromPoint(tCurPos.x, tCurPos.y)
If TypeName(oCell) = "Range" Then
If eScope = IndividualHyperlinks Then
If oCell.ID = "HyperlinkDisabled" Then
With Application: .DisplayFullScreen = .DisplayFullScreen: End With
End If
Else
With Application: .DisplayFullScreen = .DisplayFullScreen: End With
End If
End If
With Application.CommandBars.FindControl(ID:=2020): .Enabled = Not .Enabled: End With
End Sub
2- Code
Usage example:
Code:
Sub Test1()
ThisWorkbook.DisableAllHyperlinkScreenTips = True
End Sub
Sub Test2()
ThisWorkbook.DisableHyperlinkScreenTip(Sheet1.Range("A1:A10")) = True
End Sub