Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Wrong current directory
I have an Excel Workbook that is saved in a directory. It contains
a VBA macro with the following code: Dim StartDir As String StartDir = CurDir MsgBox (StartDir) .. . . However, it says that the current directory is another one, not the one in which the Workbook is saved. Why would it do this? I am new to VBA. Thanks, Alan |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Wrong current directory
maybe your file is on a different drive, i don't know because you didn't give
many details. try this if you're looking for the current directory on another drive, such as D, in this case. StartDir = CurDir("D") -- Gary "Alan" wrote in message ... I have an Excel Workbook that is saved in a directory. It contains a VBA macro with the following code: Dim StartDir As String StartDir = CurDir MsgBox (StartDir) . . . However, it says that the current directory is another one, not the one in which the Workbook is saved. Why would it do this? I am new to VBA. Thanks, Alan |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Wrong current directory
Thisworkbook.path will give you the folder where the workbook is saved. CurDir is something else. Tim "Alan" wrote in message ... I have an Excel Workbook that is saved in a directory. It contains a VBA macro with the following code: Dim StartDir As String StartDir = CurDir MsgBox (StartDir) . . . However, it says that the current directory is another one, not the one in which the Workbook is saved. Why would it do this? I am new to VBA. Thanks, Alan |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Wrong current directory
Tim,
Thank you. I wonder what CurDir actually is. Alan On Jul 17, 10:28*pm, "Tim Williams" <timjwilliams at gmail dot com wrote: Thisworkbook.path will give you the folder where the workbook is saved. *CurDir is something else. Tim |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Change current directory to the directory that the workbook loads from! | Excel Programming | |||
current directory | Excel Discussion (Misc queries) | |||
Current Directory | Excel Discussion (Misc queries) | |||
get current directory | Excel Programming | |||
changing current directory to that of the current open file | Excel Programming |