Command to open a file on a S Drive Error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SusanK4305
    New Member
    • Sep 2010
    • 88

    Command to open a file on a S Drive Error

    When I click the button I get this Error
    "Run-time error '53' file not found"

    What am I doing wrong?

    Code:
    Private Sub Command8_Click()
    'Note: This is to open S Drive file for notes Managment only
    On Error GoTo Err_Command8_Click
    
        Dim stAppName As String
    
        stAppName = "S:\Security\Operations Support\Intake DB"
        Call Shell(stAppName, 1)
    
    Exit_Command8_Click:
        Exit Sub
    
    Err_Command8_Click:
        MsgBox Err.Description
        Resume Exit_Command8_Click
        
    End Sub
    Last edited by Frinavale; Oct 6 '10, 05:50 PM. Reason: Please post code in [code] ... [/code] tags. Added code tags and moved the question above the posted code.
  • Mariostg
    Contributor
    • Sep 2010
    • 332

    #2
    You have to specify what program to use to open your file. If you want to open it with Notepad use:
    Code:
    stAppName = "notepad.exe S:\Security\Operations Support\Intake DB"

    Comment

    • MMcCarthy
      Recognized Expert MVP
      • Aug 2006
      • 14387

      #3
      Also I would normally include the file extension. For example ...

      Code:
      stAppName = "MSAccess.exe S:\Security\Operations Support\Intake DB.mdb"

      Comment

      • Mariostg
        Contributor
        • Sep 2010
        • 332

        #4
        Yes of course... And I would avoid spaces in my file and directory names.

        Comment

        • SusanK4305
          New Member
          • Sep 2010
          • 88

          #5
          ??? why would I open a file as an exe doc?
          ummm ok I am opening a File that has documents in it. I don't want to Open any 1 document just to take them to the file.

          Comment

          • MMcCarthy
            Recognized Expert MVP
            • Aug 2006
            • 14387

            #6
            Susan

            Are you trying to open a file or a folder?

            The MSAccess.exe part is not for the file it is for the application used to open the file.

            If you are trying to open a folder this is not the way to do it.

            Comment

            • SusanK4305
              New Member
              • Sep 2010
              • 88

              #7
              oops! yes a folder

              Comment

              • NeoPa
                Recognized Expert Moderator MVP
                • Oct 2006
                • 32633

                #8
                Susan,

                You need to explain what you actually need. In clear English please. It is not acceptable to post questions after two seconds of preparations as this wastes the time of our experts. Work out the question first then post it only when it makes proper sense.

                I think we can probably help here, but it's still unclear what type of "Open" you're even after.

                Comment

                • SusanK4305
                  New Member
                  • Sep 2010
                  • 88

                  #9
                  I just want a command button to open a folder on the SDrive the path is as follows.
                  "S:\Security\Op erations Support\Intake DB"

                  Comment

                  • NeoPa
                    Recognized Expert Moderator MVP
                    • Oct 2006
                    • 32633

                    #10
                    After all that explanation you come back with a post that took you two seconds to submit and even less to consider. If that were indeed true then we wouldn't need to keep asking you for further clarification would we? Please either get involved and pay attention, or give up. Otherwise you're simply wasting everyone's time and, you may be able to tell, patience is running thin.

                    Comment

                    Working...