+ Reply to Thread
Results 1 to 8 of 8

Browse with imput box

  1. #1
    Forum Contributor
    Join Date
    01-21-2005
    Location
    Colorado
    MS-Off Ver
    2000,2003,2007
    Posts
    481

    Unhappy Browse with imput box

    I want to use an input box in which the user could either type the path and file name for a file that is to be used in my code. i.e. the file which contains the data to be manipulated.
    However if they don't know the exact path and file name I want to allow them to browse the hard drive to find and select the file required.
    Is there any way to add a browse option to a VBA input box?

    Thanks

  2. #2
    Forum Contributor
    Join Date
    11-16-2004
    Posts
    282
    Straight from the Visual Basic Help file topic FindFile:

    FindFile Method Example

    This example displays the Open dialog box.

    Application.FindFile


    Hope this helps,
    theDude

  3. #3
    Forum Contributor
    Join Date
    01-21-2005
    Location
    Colorado
    MS-Off Ver
    2000,2003,2007
    Posts
    481
    Thanks TheDude, exactly what I was after.

  4. #4
    Registered User
    Join Date
    04-16-2005
    Posts
    9
    I was working on the same problem... my question is, what if I only want the path directory and not to open the file?

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello,

    This is in response to Silverh's question...

    Returning Only the Path from the Open Dialog Box:
    MyPath = CurDir(Application.GetOpenFileName)

    Sincerely,
    Leith Ross
    Last edited by Leith Ross; 04-17-2005 at 04:44 AM.

  6. #6
    Registered User
    Join Date
    04-16-2005
    Posts
    9
    Thank you very much mr. Leith Ross.

  7. #7
    Forum Contributor
    Join Date
    01-21-2005
    Location
    Colorado
    MS-Off Ver
    2000,2003,2007
    Posts
    481

    Browse with input box

    Leith,
    Thanks. I can use that command as well.
    Is there also an easy way to return just the file name given the full path. I have a function set up that looks backwards from the end of the full path and finds the first backslash but a one-line command would be cleaner in my code.

    Thanks again

  8. #8
    Forum Contributor
    Join Date
    01-21-2005
    Location
    Colorado
    MS-Off Ver
    2000,2003,2007
    Posts
    481

    Browse with input box

    FYI,
    I found the command I was asking about in previous post.
    Using:
    Dir(FullPath)
    without any attributes specified will give the file name with extension.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1