Directory

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I was using logic to set a variable equal to a path

tempPath = Application.GetOpenFilename("Excel Files, *.xls")
Workbooks.Open filename:=tempPath

I also did other logic envolving the tempPath. But there is a problem
because when select the file I start out in another directory. I want to
start out in the same directory because this is easier to navigate to the
file I want. I tried using

ChDir "C:\"

but this did not work, I always seem to start out in another directory. Is
there anyway to have it so that I start out in

"C:\"?

Thanks for your help
 
Jeff,

You need to change the drive, then the path:

ChDrive "C"
ChDir "C:\FolderName"

HTH,
Bernie
MS Excel MVP
 
Back
Top