+ Reply to Thread
Results 1 to 2 of 2

Load Dialog Box in the last directory path opened

  1. #1
    Registered User
    Join Date
    06-18-2014
    Location
    Houston, TX
    MS-Off Ver
    2010
    Posts
    63

    Load Dialog Box in the last directory path opened

    I have a file which is opened every so often. This file when opened it presents a userform in which you browse two files which then get loaded into the document and some charts/pivots are updated with the information from the loaded files.

    When you click on the browse button it opens the browser dialog box in the libraries path. I am wondering if it's possible to have the dialog box open in the last directory path used.

    For example:

    A week ago I opened the file from the path C:\Users\Inti\Documents\Projects\Tea Project

    What I would like to happen is that when I open the file today and I click the "Browse" button (which opens the dialog box to find files in your computer) for the dialog box to open automatically in the path C:\Users\Inti\Documents\Projects\Tea Project

    Then if tomorrow the file is opened from the path C:\Users\Inti\Pictures\Projects\Tea2Project
    Then a week from now when you browse for the file the dialog box opens automatically in the C:\Users\Inti\Pictures\Projects\Tea2Project path

    This is what I have right now and it always opens the dialog box on C:\Users\Inti\Documents

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Load Dialog Box in the last directory path opened

    The only way to accomplish that is to store the path somewhere. A cell, worksheet property (like Author), or worksheet variable.

    Then upon opening, recall the value and change the current path.

    In the ThisWorkbook module:
    Please Login or Register  to view this content.
    When GetOpenFilename opens, it will be at the stored path.

    Then, in the browse event of the userform, store the path back to the property.
    Please Login or Register  to view this content.
    David
    (*) Reputation points appreciated.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Save As Dialog Box - Default Path and File Name, User Selects Sub Folder from Default Path
    By christenprochaska in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-12-2012, 05:17 PM
  2. [SOLVED] Get directory path where macro was opened manually.
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-14-2012, 09:54 PM
  3. How to set GetOpenfile dialog start path to current open files path.
    By Michael Wise in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-03-2010, 02:24 PM
  4. Displaying the current opened file's directory path?
    By doubleEbuck in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-25-2008, 06:18 PM
  5. [SOLVED] Load all files in a directory
    By Greg B... in forum Excel General
    Replies: 2
    Last Post: 03-02-2005, 09:06 AM

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