Hello Guys,
I am trying to get my code to follow a file path if it exists or just pop-up a msgbox if it doesn't. However now it is just basically showing me the pop up. What am I doing wrong? Here is my code:
Thank you
I am trying to get my code to follow a file path if it exists or just pop-up a msgbox if it doesn't. However now it is just basically showing me the pop up. What am I doing wrong? Here is my code:
Code:
Private Sub cmdGotoFolder_Click()
Dim strFile As String
Dim strFilePath As String
strFile = Me.cboFolders.Column(1)
strFilePath = "C:\" & strFile
If Dir(strFilePath) <> "" Then
Application.FollowHyperlink strFilePath
Else
MsgBox "No folder was found!" & vbNewLine & "Please create one and try again" & vbNewLine & "Thank you.", vbCritical, "No Folder found!"
End If
End Sub
Thank you