Using GetOpenFilename

R

Robin Seaby

I'm working on a macro that uses GetOpenFilename to return
the name of a .dat file that is used to load saved data
into a userform.

Is there a way that I can specify the directory that is
opened in the dialog box? I'm afraid the users will not
know where to look otherwise.

I have been able to specify the directory when using
GetSaveAsFilename to save these same .dat files.

Cheers.
 
D

Dick Kusleika

Robin

Use ChDir to change the current directory before the GetOpenFilename line.
GetOpenFilename opens to the current directory.
 
T

Tom Ogilvy

Chdrive "D"
Chdir "D:\data1\data2\mydata"

' now do getopenfilename

Regards,
Tom Ogilvy
 

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

Similar Threads


Top