PDA

View Full Version : Solved: changing the default file path



philfer
11-30-2007, 11:55 AM
I am using an excel workbook for some calculations (c:\phil\calc) and I need to copy in some data from another set of workbooks (c:\phil\data). The path for the data workbooks are different from the calculation workbook. In order to make it easy for the users I do the following :-
Application.DefaultFilePath = "C:\phil\data"

myfile = Application.GetOpenFileName
Workbooks.Open (myfile)

(then copy and paste)


Application.DefaultFilePath = "C\phil\calc"

However when the GetOpenFileName method runs it does not have the data file path as I expected.

Do you know why this is?

lucas
11-30-2007, 12:35 PM
http://vbaexpress.com/forum/showthread.php?t=9283