Code:
Sub TryOpenFileOpenFolder()
Dim FileNameRef1 As String, FileNameRef2 As String, myPath As String
FileNameRef1 = Application.WorksheetFunction.Text(Range("A1"), "General")
FileNameRef2 = Application.WorksheetFunction.Text(Range("J1"), "General")
myPath = "C:\Users\KYD\Desktop\"
On Error Resume Next
ThisWorkbook.FollowHyperlink myPath & FileNameRef1 & " " & FileNameRef2 & ".pdf"
If Err.Number <> 0 Then MsgBox "File " & "[-> " & FileNameRef1 & " " & FileNameRef2 & ".pdf" & " <-]" & " not found" & vbNewLine & "Folder " _
& myPath & " not found", vbExclamation, Title:="header"
End Sub
hello everyone these codes search file pdf in directory and open it, else show warning message not available, as you know cant change fonts or background etc etc of vb warning boxes. so if it possible to make custom warning box with part of the text can have different color or make it bold....or how to make these codes work in user form dialog boxes.
Thnx