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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting Current Excel Application's Path? 1

Status
Not open for further replies.

sjh

Programmer
Joined
Oct 29, 2001
Messages
263
Location
US
Hi,

I have an Excel VBA application. Is it possible to figure out the directory path where my Excel application is stored using VBA code? I tried CurDir() and Application.Path, but they didn't return the correct value.

Thanks in advance!
Susie
 
You want this ?
ThisWorkbook.Path

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hi Susie,

Application.Path gives the path to the (Excel) application - in my case, for example, D:\Microsoft Office 2003\Office11

What exactly do you mean when you say you have an Excel VBA application? Is it code in a workbook? or a COM AddIn? or what? ThisWorkbook.Path might work for you; if not, come back with a bit more detail.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
In a set_header_footer routine I've used

.LeftFooter = ActiveWorkbook.path + "\" + ActiveWorkbook.name

but I really don't know how this differs from PHV's ThisWorkbook.Path

Hopefully PHV can explain.
 
ThisWorkbook is where the VBA is.
ActiveWorkbook is the active one and thus not necessarly the same as above.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks PHV that makes sense now.
[tt]
("`-''-/").___..--''"`-._
`6_ 6 ) `-. ( ).`-.__.`)
(_Y_*.) ._ ) `._ `. ``-..-'
_..`--'_..-_/ /--'_.' ,'
(il), '' (li),' ((!.-'
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top