+ Reply to Thread
Results 1 to 4 of 4

Opening file and extracting file name and filepath

  1. #1
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Opening file and extracting file name and filepath

    I have the following code that takes the file name & filepath and populates cells with the data but for some reason this one won't work, it will populate the filename but not the filepath.

    Any ideas??

    Please Login or Register  to view this content.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,069

    Re: Opening file and extracting file name and filepath

    Looks like you're making hard work of that. Why not just use:

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Re: Opening file and extracting file name and filepath

    Thanks, where would i add the cells i need the data in?

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,069

    Re: Opening file and extracting file name and filepath

    where would i add the cells i need the data in?
    Where you are putting it now?

    Please Login or Register  to view this content.

    Note that you'll only get a path for a saved workbook. Could that be why you're not getting what you expect. And your code appears to be working on the File Name which wouldn't have any "\"s in it as that's a Path Separator and would only appear in the Path or FullName properties.


    Regards, TMS
    Last edited by TMS; 11-06-2013 at 06:54 AM.

+ 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. Store Selected FilePath Without Opening File
    By gammaman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-23-2013, 11:02 AM
  2. [SOLVED] Trying to get the filepath on "Open", but get filepath of a temporary file instead
    By ianpwilliams in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 08-22-2013, 12:27 AM
  3. Creating a .txt file extracting information from a Excel file saving as .resx file
    By AbdallahHajbed in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-19-2012, 09:00 AM
  4. Opening file message when opening a file from an http address
    By The_Real_MerlinXL in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-26-2010, 12:33 PM
  5. Replies: 1
    Last Post: 12-07-2005, 01:55 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