Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting folder address of where excel file is run from

Status
Not open for further replies.

Jooky68

Programmer
Jul 10, 2002
231
US
Is there a quick easy way to get the folder address for the excel file that I am running. I am trying to get the address while im running the excel file.
 
Try:
Code:
Dim fso, fName, fPath
Set fso = CreateObject("Scripting.FileSystemObject")
Set fName = ActiveWorkbook
fPath = UCase(fName.Path)
MsgBox fPath
You can then have a worksheet cell, msgbox, or any other control that can accept text have this value passed to it.

Dan.
 
Another way - use excel Path property:
Workbooks(i).Path
or
Activeworkbook.Path

combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top