Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Getting Path Of .XLS?

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).

??
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Getting Path Of .XLS?

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)



"PeteCresswell" wrote in message
...
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).

??


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Getting Path Of .XLS?

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.

"Chip Pearson" wrote in message
...
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)



"PeteCresswell" wrote in message
...
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).

??



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove end folder from path found with ThisWorkbook.Path command ? dim Excel Programming 9 April 23rd 08 06:04 AM
Formula too long - new file path is shorter than old file path - Excel 2003 Greg J Excel Worksheet Functions 1 November 22nd 06 05:16 PM
hyperlink navigation path path wrong in Excel 2003 CE Admin Excel Discussion (Misc queries) 5 January 7th 06 07:47 PM
how to change absolute path to relative path hwijgerse Excel Worksheet Functions 0 November 25th 05 07:18 AM
Current path to Qualified Path Mary Excel Programming 1 October 14th 04 02:42 PM


All times are GMT +1. The time now is 01:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"