# Solved: CurDir in EXCEL VBA



## TinkeringTom (Sep 28, 2007)

I need to be able to obtain the current working directory and CurDir isn't doing it for me.
No matter where I'm at below "My Documents", that as far as CurDir will return.

For example, my working directory is:
C:\Documents and Settings\TomD\My Documents\Organization\Development\

And with the following commands:

FileName = CurDir
MsgBox FileName

I get this:

C:\Documents and Settings\TomD\My Documents\

Any assistance will be greatly appreciated


----------



## Rollin_Again (Sep 4, 2003)

Does the Excel workbook that the macro is being run from reside in the directory in question? If so just use *ActiveWorkbook.Path* to get the directory path. I believe *CurDir* will only return the correct path if you open Excel first and then open the workbook within the application using *FILE >> OPEN*

Regards,
Rollin


----------



## TinkeringTom (Sep 28, 2007)

Rollin_Again said:


> Does the Excel workbook that the macro is being run from reside in the directory in question? If so just use *ActiveWorkbook.Path* to get the directory path. I believe *CurDir* will only return the correct path if you open Excel first and then open the workbook within the application using *FILE >> OPEN*
> 
> Regards,
> Rollin


Hi Rollin,

That works perfectly! Thanks you so much.

Sincerely,
Tom


----------

