Hello,
I have managed to put up following codes to open pdf file and folder containing other files.
![]()
Sub openfile() Dim FileNameRef As String FileNameRef = Application.WorksheetFunction.Text(Range("D1"), "d mmm") ThisWorkbook.FollowHyperlink "C:\Users\Laxman\Documents\" & FileNameRef & ".pdf"
Can you guys please help in combining the above two macros, so that the macro will first try to open the pdf file and if it cannot find the file then open folder instead. Also to set an error message, if it cannot even open folder.![]()
Sub openfile2() ThisWorkbook.FollowHyperlink "C:\Users\Laxman\Documents\" End Sub
Thank You!
Bookmarks