+ Reply to Thread
Results 1 to 3 of 3

FileDialogFilePick a file, then get the folder path

  1. #1
    Registered User
    Join Date
    10-17-2011
    Location
    Seattle, USA
    MS-Off Ver
    Excel 2007
    Posts
    79

    FileDialogFilePick a file, then get the folder path

    Hi,

    I have what is certainly a very basic question, but which stuck me for hours (not totally lost since I learned quite few interesting things while digging around for the answer )

    Once a file has been selected, I need to extract the path to go to the parent folder. In the code below, I have removed everything not relevant to my project, so that my problem will hopefully be clear.
    I have a way to do it, by removing the n+1 characters from the right of the total path (filename included, n being the length of the filename) but this is not elegant and certainly not the way to do it.

    Thank you for your time!


    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    04-24-2007
    Location
    NYC
    MS-Off Ver
    2k3/2k7/2010
    Posts
    270

    Re: FileDialogFilePick a file, then get the folder path

    That is the way, find the "\" and stop.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-17-2011
    Location
    Seattle, USA
    MS-Off Ver
    Excel 2007
    Posts
    79

    Re: FileDialogFilePick a file, then get the folder path

    Thank you.
    This is actually the way I already do it when I described my current method. I am looking for a way to do it using something like .Path, .FolderName, ... if such a way exists.

+ 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. Code to list the folder path and sub folder path of a specific file
    By kalai1587 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-13-2013, 03:51 AM
  2. [SOLVED] how to insert file path of every file in a folder as a string?
    By Gamekiller48 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-31-2013, 02:01 PM
  3. [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
  4. [SOLVED] Need File Name from a particular assigned folder path.
    By Naveed Raza in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-07-2012, 05:05 AM
  5. Specified folder path to select file path
    By JayEmTee91 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-29-2012, 10:38 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