How to Get a Full File Path in Excel?

Ever needed to find out the full path of your current file? What I mean by full path here is the full location of the active file including the directory path and full file name.

If you did, then what you need is this following code:

Application.ActiveWorkbook.FullName

The one line code will return the full directory path + filename of the active file, ex:
D:\My Directory\filename.xls

To simply use it from our formula bar, we can wrap the code into excel vba function like this:

Function FULLFILENAME()

     FULLFILENAME = Application.ActiveWorkbook.FullName

End Function

Every time we needed the information, just call the FULLFILENAME function from the formula bar.

Related Entries

  • How To Find the Last Row That Contain Data in Excel?

    UPDATE June 13, 2008: Another alternative way to find the last row with data :Function LastRow() As LongDim ix As Long ix = ActiveSheet.UsedRange.Row - 1 + ActiveSheet.UsedRange.Rows.Count LastRow = ixEnd FunctionI did a simple test, and the function will return the correct last row position...

  • Finding Cell with Minimum/Maximum Value in Active Worksheet

    Let say we want to find position of cell containing the minimum/maximum value in current/active Excel worksheet, and then after we found the cell, we will change the cell format to make it stand out before other cells. The logic is simple, we just need to use Excel MIN function to find the minimum/maximum value on...

  • How To Open Excel File Using Macro

    Imagine this condition; We are in the middle of doing something using Excel VBA macro, then we want the macro to automatically show the File Open dialog box to make us (user) able to choose another Excel file to be opened by Excel. Got the picture? Below is vba procedure that do exactly like that, show...

  • Schedules to Refresh Data Automatically using VBA Macro

    I once asked by Joshuacht about how to make a macro running every 15 minutes. Let say because every 15 minutes we have to refresh or reload the data in the Workbook. Below is a sample of how we can do this in Microsoft Excel *just an outline*. The logic is simple, when we open the...

  • Number of Cells/Rows/Columns With Formula

    A few weeks ago I received this question from someone called LS: Hi I want to write a macro that counts the following - Number of cells with formula - Number of Rows with formula - Number of Columns with formula Please let me know if there is a way of doing it in Excel VBA To find out the number of...

Valuable Resources

If you found this page useful, please consider bookmark it using social media or add a link to this page.

  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • connotea
  • Diigo
  • email
  • Fark
  • Identi.ca
  • Live
  • MisterWong
  • MySpace
  • Netvibes
  • NewsVine
  • PDF
  • Ping.fm
  • Propeller
  • Reddit
  • Simpy
  • StumbleUpon
  • Technorati
  • Twitter
  • Wikio
  • Yahoo! Bookmarks