View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Elceller in distress[_2_] Elceller in distress[_2_] is offline
external usenet poster
 
Posts: 23
Default FileDialog question

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

fd.InitialFileName = strDir
fd.Show




"LeAnn" wrote:

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