get current filepath in excel vba

  • Thread starter Thread starter matt
  • Start date Start date
M

matt

i've got a macro that refernces other files. rather than hard code the
filepath for the folder the excel file is in, is there a way to determine
the current filepath? it's just that i have different users who have
different shortcuts to the folder and don't want to hard code.

cheers in advance
Matthew
 
The path of an open workbook?

msgbox activeworkbook.path 'the activeworkbook
msgbox thisworkbook.path 'the workbook with the code

msgbox curdir 'the current directory (when you hit File|open)
 
does this help?
Sub whatisfilepath()
MsgBox ActiveWorkbook.Path
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top