#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 921
Default Directory

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,441
Default Directory

Jeff,

You need to change the drive, then the path:

ChDrive "C"
ChDir "C:\FolderName"

HTH,
Bernie
MS Excel MVP


"Jeff" wrote in message
...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
Code to raise Directory request box ANDYGM Excel Worksheet Functions 2 April 10th 06 11:47 AM
Saving to "open" directory 9119 New Users to Excel 2 January 19th 06 02:39 PM
Staying it its own directory. Steven Excel Worksheet Functions 1 January 7th 06 11:25 PM
change directory for refresh data TxRaistlin Excel Discussion (Misc queries) 0 February 7th 05 09:09 PM


All times are GMT +1. The time now is 05:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"