Open a folder

G

Guest

I am trying to find if VBA has a utility that makes it possible to set the
Open File Dialog to a specific folder.
For example, if I use this code
Application.GetOpenFilename("Text Files (*.txt), *.txt")
 
G

Guest

Hi Ayo,

See if the following example helps. However I have not tested it with your
specific requirement.

Sub Return_Set_Path()

'Return the current default file path
MsgBox Application.DefaultFilePath

'Set the default file path
'Note:The following resets the default file path
'to save/open all Excel files as if it has been set in options.

strpath = Application.DefaultFilePath & "\Test"
Application.DefaultFilePath = strpath
MsgBox Application.DefaultFilePath

End Sub

Regards,

OssieMac
 

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