Need help with FileDialog Object

M

Marty L

I would like to use the FileDialog object to allow the user to select a path
to store a file created by my vba application. I am doing this in EXCEL.
It works fine, however since there is only one instantiation of the object,
the normal EXCEL FILE OPEN, FILE SAVE etc get changed to the path the user
selected from my use of the object.

How do I set the FileDialog 'default' path back to the
Application.DefaultPath (without actually opening the dialog) so the next
time the user selects FILE, SAVE in EXCEL it defaults to the
Application.DefaultPath? Or should I be using a different method for my
user interface?

Thanks, Marty
 
C

Cindy M.

Hi Marty,

You may want to ask about this in excel.programming whether there's a "better"
way. But a couple of tests in Excel show that you can use ChDrive plus ChDir to
reset the CurDir (current directory) for Excel's File/Open. I think File/Save
As should, in any case, default to the location the current file has been
opened from.
I would like to use the FileDialog object to allow the user to select a path
to store a file created by my vba application. I am doing this in EXCEL.
It works fine, however since there is only one instantiation of the object,
the normal EXCEL FILE OPEN, FILE SAVE etc get changed to the path the user
selected from my use of the object.

How do I set the FileDialog 'default' path back to the
Application.DefaultPath (without actually opening the dialog) so the next
time the user selects FILE, SAVE in EXCEL it defaults to the
Application.DefaultPath? Or should I be using a different method for my
user interface?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
M

Marty L

Thanks Cindy - I had tried saving the path (from CurDir) and then reset
after my routine with ChDir, but it didn't seem to work at least my initial
attempt (perhaps I was doing something else wrong) - the SAVEAS dialog still
went to the path the user had selected with my FIleDialog. I will play with
this some more however! Thanks again - Marty
 

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