+ Reply to Thread
Results 1 to 3 of 3

BrowseForFolder Shell.Application to return absolute path

  1. #1
    Forum Contributor
    Join Date
    10-22-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    162

    BrowseForFolder Shell.Application to return absolute path

    Hi,

    I'm using an adaptation of the BrowseForFolder code as detailed here: https://www.slipstick.com/developer/...lepaths-macro/

    The piece of the code I'm having problems with is:
    Please Login or Register  to view this content.
    For sub folder locations and desktop locations it works fine, returning the absolute folder path. But for a networked drive it's only returning the relative path, e.g. J:\
    Is there a way I can get the Shell.Application to return the absolute path?

    I've searched on this and can't seem to find an answer. I've also searched for ways to convert the relative path to an absolute one, but again this doesn't seem to be easy to do. GetFileInfo appears to be a VB rather than VBA method.

    Any pointers appreciated.

    Thanks, TC.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,879

    Re: BrowseForFolder Shell.Application to return absolute path

    HAve you tried thios approach: http://blog.discussexcel.com/learn-m...hofmappeddrive (may be combined with the one you are using - try to convert to real network path, and if that fails assume it is local one)?
    Best Regards,

    Kaper

  3. #3
    Forum Contributor
    Join Date
    10-22-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    162

    Re: BrowseForFolder Shell.Application to return absolute path

    Yep that fixed it. Thank you.

    Had not come across GetDriveName.

+ 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. Replies: 0
    Last Post: 08-18-2017, 02:55 PM
  2. Changing An Absolute Path To A Relative Path
    By elgourmet in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-03-2010, 05:21 AM
  3. [SOLVED] Full folder path from BrowseForFolder
    By Jon in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-02-2006, 06:15 PM
  4. how to change absolute path to relative path
    By hwijgerse in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 11-25-2005, 03:18 AM
  5. [SOLVED] relative path in shell command (excel)
    By SpeeD in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-16-2005, 01:52 PM
  6. Return to Excel after shell an application
    By abc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-12-2005, 06:05 AM
  7. Shell can open an application, can it close an app too?
    By quartz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-26-2005, 11:06 AM

Tags for this Thread

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