Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How do I show a file dialog box? (Excel 2000 (9.0.6926 SP-3))

    I have created a macro in a "summary" file which asks for a filename, currently using an Inputbox. The filename is then used to paste links into a worksheet. The files represent data which is collected in a separate file each day. The macro accumulates this data in the summary file by being run every day after the daily file is saved. The daily filenames change, of course, so I will always need to ask for it. Unfortunately, I'm dealing with individuals who have trouble finding the file. I would like to present them with a dialog box, but when I use "Application.Dialogs(xlDialogFindFile).Show", Excel opens the file. I don't need the file open, I just want to give the user an easy way to find the file. Any suggestions? I'd like to replace the Inputbox with something easier since I'm trying to make this as fool-proof as possible. I've included the VBA code for reference. It's nothing fancy.

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: How do I show a file dialog box? (Excel 2000 (9.0.6926 SP-3))

    Application.GetOpenFileName

    is probably what you are looking for. Note that it gets the path and name of the file, but requires a separate command to actually open the file. <!post=Here,353109>Here<!/post> Hans shows how to code it, including cancel handling.
    -John ... I float in liquid gardens
    UTC -7ąDS

  3. #3
    Lounger
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How do I show a file dialog box? (Excel 2000 (9.0.6926 SP-3))

    That did it! Thanks!

  4. #4
    3 Star Lounger
    Join Date
    Jan 2004
    Location
    Birmingham, West Midlands, United Kingdom
    Posts
    219
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How do I show a file dialog box? (Excel 2000 (9.0.6926 SP-3))

    Thanks, jmr, for annotating your code. This is a great help for newbies and wannabe vba freaks as a learning tool.
    And glad you got your problem solved!

Posting Permissions

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