Shell Command not working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Hutch
    New Member
    • Mar 2007
    • 74

    Shell Command not working

    Private Sub Command5_Click( )
    Dim TaskId As Variant
    TaskId = Shell("[C:\Documents and Settings\daveh\ My Documents\1011. pdf]")
    End Sub

    For some reason this code is not working i have checked the path name several times and it is correct, Any thoghts. Thanks in advance.
  • FishVal
    Recognized Expert Specialist
    • Jun 2007
    • 2656

    #2
    Originally posted by Hutch
    Private Sub Command5_Click( )
    Dim TaskId As Variant
    TaskId = Shell("[C:\Documents and Settings\daveh\ My Documents\1011. pdf]")
    End Sub

    For some reason this code is not working i have checked the path name several times and it is correct, Any thoghts. Thanks in advance.
    Hi, Hutch.

    Try to remove square brackets from the path.

    Comment

    • Hutch
      New Member
      • Mar 2007
      • 74

      #3
      Still no work any thing else?

      Comment

      • FishVal
        Recognized Expert Specialist
        • Jun 2007
        • 2656

        #4
        Originally posted by Hutch
        Still no work any thing else?
        Oh, sorry. Didn't notice you try to run pdf. ;)
        Use FollowHyperlink instead of Shell.

        Comment

        • missinglinq
          Recognized Expert Specialist
          • Nov 2006
          • 3533

          #5
          I know it seems basic, but is the machine you're running this on set up with a default for running .pdf files?

          Linq ;0)>

          Comment

          • Hutch
            New Member
            • Mar 2007
            • 74

            #6
            opps i posted the wrong link, it's an app im trying to run. look at this code

            Private Sub Command5_Click( )
            Shell "Explorer \\Specserv\spec sales\User Data\User Database\Call Logs.mdb"
            End Sub

            This actually opens the code i had to add "Explorer" to the begining of it. But now i get a prompt asking me if i am sure i want to Down Load the file. How do i get rid of this?!

            Comment

            • FishVal
              Recognized Expert Specialist
              • Jun 2007
              • 2656

              #7
              Originally posted by Hutch
              opps i posted the wrong link, it's an app im trying to run. look at this code

              Private Sub Command5_Click( )
              Shell "Explorer \\Specserv\spec sales\User Data\User Database\Call Logs.mdb"
              End Sub

              This actually opens the code i had to add "Explorer" to the begining of it. But now i get a prompt asking me if i am sure i want to Down Load the file. How do i get rid of this?!
              And what about
              Code:
              FollowHyperlink "\\Specserv\spec sales\User Data\User Database\Call Logs.mdb"
              or maybe
              Code:
              CreateObject("Access.Application").OpenCurrentDatabase "\Specserv\spec sales\User Data\User Database\Call Logs.mdb"
              ??

              Comment

              • JKing
                Recognized Expert Top Contributor
                • Jun 2007
                • 1206

                #8
                Originally posted by Hutch
                opps i posted the wrong link, it's an app im trying to run. look at this code

                Private Sub Command5_Click( )
                Shell "Explorer \\Specserv\spec sales\User Data\User Database\Call Logs.mdb"
                End Sub

                This actually opens the code i had to add "Explorer" to the begining of it. But now i get a prompt asking me if i am sure i want to Down Load the file. How do i get rid of this?!
                Try this:
                [code=vb]
                Private Sub Command5_Click( )
                Shell "MSACCESS.E XE ""\\Specserv\sp ec sales\User Data\User Database\Call Logs.mdb"""
                End Sub
                [/code]

                Comment

                Working...