VBA can't find path opening PDF file...error...Need HELP!!!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sclinkenbeard
    New Member
    • Mar 2008
    • 5

    VBA can't find path opening PDF file...error...Need HELP!!!

    This is the script that won't find any of my pdf files...error states file can't be found and I know the path is correct...If anyone can help...Please. I have tried many pdf docs with the same results. What am I doing wrong in my script?

    Sub test()
    Dim RetVal

    RetVal = Shell("C:\Progr am Files\Adobe\Rea der 8.0\Reader\Acro Rd32.exe C:\Documents and Settings\Owner\ My Documents\dwdm. pdf, 1")
    End Sub
  • Sick0Fant
    New Member
    • Feb 2008
    • 121

    #2
    Originally posted by sclinkenbeard
    This is the script that won't find any of my pdf files...error states file can't be found and I know the path is correct...If anyone can help...Please. I have tried many pdf docs with the same results. What am I doing wrong in my script?

    Sub test()
    Dim RetVal

    RetVal = Shell("C:\Progr am Files\Adobe\Rea der 8.0\Reader\Acro Rd32.exe C:\Documents and Settings\Owner\ My Documents\dwdm. pdf, 1")
    End Sub
    My best guess is that it's interpretting C:\Documents and Settings\Owner\ My Documents\dwdm. pdf as 3 arguments because of the spaces. Try putting the path in quotes.

    Comment

    • sclinkenbeard
      New Member
      • Mar 2008
      • 5

      #3
      Quotes generates a compile error.

      Comment

      • Sick0Fant
        New Member
        • Feb 2008
        • 121

        #4
        Originally posted by sclinkenbeard
        Quotes generates a compile error.
        You have to escape them, of course! Use "" to represent "

        Comment

        • sclinkenbeard
          New Member
          • Mar 2008
          • 5

          #5
          Still comes up file can't be found. Thanks anyway. Not sure the issue but it appears no one else on this help page does either.

          Comment

          Working...