john316swan
Board Regular
- Joined
- Oct 13, 2016
- Messages
- 66
- Office Version
- 2019
- Platform
- Windows
When I double click on the target, the link is opening to the UNC path instead of the mapped location. Can someone let me know how to prevent this? Thank you!
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim activeFolder As String
Dim studentFolder As String
activeFolder = "M:\Financial Aid\ELECTRONIC FILES\TRADITIONAL UNDERGRAD\"
Cancel = True
If Target.Column = 1 Then
On Error GoTo ErrMsg
studentFolder = activeFolder & Left(Target.Offset(x, 2), 1) & "\" & Target.Offset(x, 2) & ", " & Target.Offset(x, 3) & " " & Right(Target.Offset(x, 0), 5)
ActiveWorkbook.FollowHyperlink Address:=studentFolder, NewWindow:=True 'will open to student folder
End If
Exit Sub
ErrMsg:
MsgBox ("Folder not named properly")
End Sub