LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default how set default path?

Thanks for any help.
I have a macro in a workbook that opens a workbook, gets some numbers out of
it, then opens another workbook, and puts the numbers in.
I could do this by hand, but there are about 15 numbers, and for once a day,
so I figure I can save some time by automating it.
The way I open the file is use getOpenFilename.
The thing is, everytime I run the macro, I have to change to the directory.
And the file I need is 4 or 5 folders down. Which takes a couple of seconds.
So I figure there is gotta be some way to set the default path so that when I
do the getOpenFilename method, it already shows the path I set in the code
just before that.
Here's the code:
....
MyFile = Application.GetOpenFilename("Microsoft Excel Application (*.xls),
*.mdb", , , , False)
Workbooks.Open MyFile
'get numbers
MyFile = Application.GetOpenFilename("Microsoft Excel Application (*.xls),
*.mdb", , , , False)
Workbooks.Open MyFile
'write numbers
I typically do this batch, for about 20 files one after another, so I only
have to set the folder the first time, but since I do the GetOpenFilename
method twice, each time I have to do about 5 or 6 clicks to get back to that
directory.
Is there someway to set the path so that when the dialog box opens, the path
is already set?
Another way I thought of doing this is not using getOpenFilename but
somekind of inputBox and a path, but I would like to try it this way.
Thanks again.

 
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
how set default path? GS Excel Programming 1 February 3rd 06 11:32 AM
how set default path? JMB Excel Programming 0 February 3rd 06 11:20 AM
Default path Maileen Excel Programming 1 September 29th 04 09:17 PM
Default Path for Add-Ins Hamilton R. Romano Excel Programming 2 July 28th 04 03:39 PM
Default File Path Tom Ogilvy Excel Programming 0 July 8th 04 02:38 PM


All times are GMT +1. The time now is 02:23 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"