E
Eugene
Hi All,
I am write a simple macro to open a PDF from VBA, but I want the name
of the PDF and location of the PDF as a string value, such that one
could assign the macro to a button in excel and use it when needed.
So far I have:
Sub pdfVBA()
Dim pdfLoc, pdfName As String
'change this to location of directory
pdfLoc = "M:\"
pdfName = ActiveCell.Value
Shell "C:\Program Files\Adobe\Acrobat 5.0\Acrobat\Acrobat.exe" & _
pdfLoc & pdfName, 1
End Sub
But I am receiving an "File not found" error. I suspect I has
something to do with using the string values, because when I replace
pdfLoc and pdfName with the location and file the code works.
Thanks for any help in advance
Eugene
I am write a simple macro to open a PDF from VBA, but I want the name
of the PDF and location of the PDF as a string value, such that one
could assign the macro to a button in excel and use it when needed.
So far I have:
Sub pdfVBA()
Dim pdfLoc, pdfName As String
'change this to location of directory
pdfLoc = "M:\"
pdfName = ActiveCell.Value
Shell "C:\Program Files\Adobe\Acrobat 5.0\Acrobat\Acrobat.exe" & _
pdfLoc & pdfName, 1
End Sub
But I am receiving an "File not found" error. I suspect I has
something to do with using the string values, because when I replace
pdfLoc and pdfName with the location and file the code works.
Thanks for any help in advance
Eugene