Getting Path Of .XLS?

  • Thread starter Thread starter PeteCresswell
  • Start date Start date
P

PeteCresswell

I'm trying to get the complete path to the .XLS my VBA code is running
in.

Actually, I just need the directory.... but either would do.

So far, all I'm able to get is the application's directory (where
Excel lives).

??
 
You can use either

ThisWorkbook.Path
' or
ActiveWorkbook.Path


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
 
Be careful using ActiveWorkbook. The ActiveWorkbook can change while your
code is running and might not be the one you expected when you query the
path property.
 

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