Consulting

Page 2 of 2 FirstFirst 1 2
Results 21 to 27 of 27

Thread: Need Help With Input Box To Open File in Specified Path

  1. #21
    VBAX Mentor 大灰狼1976's Avatar
    Joined
    Dec 2018
    Location
    SuZhou China
    Posts
    479
    Location
    Sorry, The picture post failed in #19.
    20180227011320160.jpg
    you can also use you original code with error handle.

  2. #22
    VBAX Mentor 大灰狼1976's Avatar
    Joined
    Dec 2018
    Location
    SuZhou China
    Posts
    479
    Location
    Is png format not uploadable? try again used jpg format.
    20180227011320160.jpg

  3. #23
    VBAX Regular
    Joined
    Dec 2018
    Posts
    23
    Location
    Do you have an English version of the picture?

  4. #24
    VBAX Mentor 大灰狼1976's Avatar
    Joined
    Dec 2018
    Location
    SuZhou China
    Posts
    479
    Location
    Sorry, I don't have it, But according to the content of the picture, should be able to find the corresponding options.

  5. #25
    VBAX Mentor 大灰狼1976's Avatar
    Joined
    Dec 2018
    Location
    SuZhou China
    Posts
    479
    Location
    An example used your original code with error handle.
    I'm disappointed that didn't use code editing.
    Attached Files Attached Files

  6. #26
    VBAX Regular
    Joined
    Mar 2019
    Posts
    30
    Location
    Hi I managed to debug it

    Sub OpenFile()Dim sFileName As Variant
    
    
     sFileName = Application.GetOpenFilename("Excel Files (*.xl*), *.xl*")
    If sFileName <> False And sFileName <> "" Then
    
    
    Call ShowForm(sFileName)
    
    
    End If
    End Sub
    
    
    Sub ShowForm(ByVal FilePath As String)
    
    
        Application.Run "'" & FilePath & "'!ShowForm"
        
        On Error GoTo ErrHandle
        Application.Run "'" & FilePath & "'!ShowForm"
        Exit Sub
    ErrHandle:
        MsgBox "You canceled the process!"
    End Sub

  7. #27
    VBAX Mentor 大灰狼1976's Avatar
    Joined
    Dec 2018
    Location
    SuZhou China
    Posts
    479
    Location
    @ham
    Are you sure "on error" under "application.run" is no problem?


    --Okami

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •