FileDialog question

L

LeAnn

I have the following code:

Dim fd As FileDialog
Dim strDir As String
strDir = "\\my network path\"
Set fd = Application.FileDialog(msoFileDialogOpen)
fd.Show
fd.InitialFileName = strDir

When I click on the button that calls the code it opens the default file
location. If I click it again it will go to the designated directory. What
am I doing wrong?

Thanks
LeAnn
 
E

Elceller in distress

Try moving the fd.show after the fd.initalfile name statement.

fd.InitialFileName = strDir
fd.Show
 
R

RB Smissaert

Yes that is better, didn't spot that one.

RBS


Elceller in distress said:
Try moving the fd.show after the fd.initalfile name statement.

fd.InitialFileName = strDir
fd.Show
 

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