I am using the version of Excel in Microsoft Office Professional Plus 2013.
Using Excel VBA, I would like to launch Adobe Reader XI and open a pdf file located in another folder.
I can successfully open the Adobe Reader file if the Excel file and the Adobe Reader file are in the same folder. Here’s the code that works:
Dim ABCfilename As String
Dim returnAcrobatfile As Variant
ABCfilename = "ABC.pdf"
acrobatFile = ThisWorkbook.Path & Application.PathSeparator & ABCfilename
returnAcrobatfile = Shell("C:\Program Files\Adobe\Reader _
11.0\Reader\AcroRd32.exe " & acrobatFile, vbNormalFocus)
However, I would like to launch Adobe Reader and program it to open a pdf file that is located in a different folder.
My Excel file is in a folder named C:\Customers\Pricing\
My Adobe file is in a folder named Z:\XYZ Company\
How should I modify the line of code that starts with returnAcrobatfile so that it opens a pdf file located in Z:\XYZ Company ?