Directory

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
 
B

Bernie Deitrick

Jeff,

You need to change the drive, then the path:

ChDrive "C"
ChDir "C:\FolderName"

HTH,
Bernie
MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top