+ Reply to Thread
Results 1 to 2 of 2

file location - function/ VBA statement.

  1. #1
    Forum Contributor
    Join Date
    12-27-2012
    Location
    cebu, Philippines
    MS-Off Ver
    Excel 2016
    Posts
    210

    file location - function/ VBA statement.

    is there some function or VBA statement that can return the current file location of the excel file?

    i am trying to create a file that is integrated with a set of files.. and what concerns me is that the specific link is hardcoded (VBA) into the file.. the main file opens and retrieves data from the other files, then closes it... and.. a problem is that.. if the file location is changed, the VBA code would get an error and discontinue.. what i am planning.. is if possible, to integrate to the code a statement that can identify the location of the file, thus regardless of the file location, the code would still continue.


    any help please...
    don't worry, there's a lot of people that are far more confused than you
    but if you liked what i suggested. Click for me the "Add Reputation" - that way, we'd be both happy.

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: file location - function/ VBA statement.

    thisworkbook.FullName gives you the file location + the file name

    thisworkbook.path gives you the file location

+ 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. Save as macro that specifies file type, file location and takes file name from three cells
    By ExcelFailure in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-13-2013, 10:09 PM
  2. Code that works in one location but not another location. (AdvancedFilter excel function)
    By 111StepsAhead in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-29-2013, 02:18 PM
  3. [SOLVED] [Help]macro to open file browser, to select a location, and save the location to a cell
    By zhuleijia in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-06-2013, 09:56 AM
  4. Replies: 1
    Last Post: 10-31-2012, 11:19 AM
  5. Moving location of file that had Hlookup function
    By telnoman in forum Excel General
    Replies: 0
    Last Post: 05-26-2010, 01:15 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