+ Reply to Thread
Results 1 to 8 of 8

macro to display UNC path

  1. #1
    Valued Forum Contributor
    Join Date
    03-28-2014
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    Excel 2016
    Posts
    696

    macro to display UNC path

    Hi,

    Can anyone help me to provide VBA code to display UNC path \\servername\sharename\path\filename

    I only know the code for normal path msgbox thisworkbook.fullname



    Regards,
    Farid

  2. #2
    Forum Contributor
    Join Date
    02-28-2012
    Location
    London, England
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    187

    Re: macro to display UNC path

    Please Login or Register  to view this content.
    That gives me the full path, hope it helps.

  3. #3
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525

    Re: macro to display UNC path

    Hi Faridwahidi,

    As long as the workbook has been saved, this should do the trick:

    Please Login or Register  to view this content.
    HTH

    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  4. #4
    Valued Forum Contributor
    Join Date
    03-28-2014
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: macro to display UNC path

    Hi,

    This is not UNC path. \\servername\sharename\path\filename


    That path can be easily obtained by using these methods

    1. Formula =SUBSTITUTE(LEFT(CELL("filename",A1),FIND("]",CELL("filename",A1))-1),"[","")

    2. or just Add Document Location in quick Access Toolbar.

  5. #5
    Valued Forum Contributor
    Join Date
    03-28-2014
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: macro to display UNC path

    Hi Trebor76,


    That is what I want. thanks a lot

    Regards,
    Farid

  6. #6
    Forum Contributor
    Join Date
    02-28-2012
    Location
    London, England
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    187

    Re: macro to display UNC path

    Certainly when I run it, it does give all that information. You must of course (as Trebor76 said above) run it on a saved workbook however.
    If you want to exclude file name jusr use:

    Please Login or Register  to view this content.
    instead of .fullname

  7. #7
    Valued Forum Contributor
    Join Date
    03-28-2014
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: macro to display UNC path

    Hi,

    my 1st comment refer to TKCBZW reply

  8. #8
    Forum Contributor
    Join Date
    02-28-2012
    Location
    London, England
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    187

    Re: macro to display UNC path

    I know this is marked as solved, but I just stumbled across this link which may provide a little more colour:

    http://support.microsoft.com/kb/160529

+ 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. Macro to display File path on Cell Mouse over
    By Mysore in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-03-2012, 01:25 AM
  2. Certain Cells Don't Display Full Network Path?
    By crwiseman in forum Excel General
    Replies: 7
    Last Post: 07-28-2011, 07:54 PM
  3. Display Workbook Path and Name in a cell
    By RichardBerry in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-13-2007, 06:12 AM
  4. Browse button to select and display the file path
    By sowetoddid in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-25-2005, 05:05 PM
  5. Display Path on userform
    By sowetoddid in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-21-2005, 05:49 PM

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