specify default path in dialog open box

S

Striker

I am using the Following to open a csv file. Is it possible to specify a
default directory path for the dialog box? For instance I would like the
box to open by default pointing to this directory K:\CSR\CDM

sfile1 = Application.GetOpenFilename("Text Files (*.csv), *.txt")
If sfile1 <> "" Then
Open sfile1 For Input As 1
End If

THanks
 
H

Harald Staff

ChDrive "K:\CSR\CDM\"
ChDir "K:\CSR\CDM\"
sfile1 = Application.GetOpenFilename("Text Files (*.csv), *.txt")

HTH. Best wishes Harald
 

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

keep formatting 2
Open CSV file 1
Inset into SQL 1
VBA to VB 12
GetOpenFilename with default filename? 5
File Open Dialog Box 2
Check number of rows? 1
Code for Select a file and save it in a different location 2

Top