R/T error 53 - File Not Found

J

JMay

Any apparent errors from the below Macro?

Sub LoadMyPdf()

Dim Filt As String
Dim Title As String
Dim Filename As Variant

'Set up list of File Filters
Filt = "PDF Files (*.pdf),*.pdf,"
Title = "Select a pdf file to open"
Filename = Application.GetOpenFilename _
(Filefilter:=Filt, Title:=Title)
Shell "C:\Program Files (x86)\Adobe\Reader 8.0\Reader\AcroRd32.exe" &
Filename, 1
'Shell Filename
End Sub
 
D

Dave Peterson

If you know that you're pointing to the correct location for the reader, then
try adding a space character after the .exe

....der\AcroRd32.exe " & ...
 
D

Dave Peterson

ps.

After trying to get the filename from the user, you may want:

if filename = false then
exit sub
end if

Just in case they clicked the cancel button.
 
J

JMay

Thanks Dave;
I added space after .exe to read ....exe " & filename, 1

and also inserted the

if filename = false then
exit sub
end if

Still getting R/T 53

I'm running XL2003 SP3 - Vista Home Premium (64-bit)
 
D

Dave Peterson

try wrapping the filename with double quotes:

"...\Reader\AcroRd32.exe " & chr(34) & filename & chr(34), 1

As an experiment, you may want to copy the .pdf file to your C:\ folder.

Rename this copy so that there are no spaces in the file (C:\a.pdf) and test
that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top