Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default FileDialog question

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default FileDialog question

Try this:

strDir = "\\my network path\"
ChDir strDir


RBS

"LeAnn" wrote in message
...
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default FileDialog question

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

RBS


"Elceller in distress" wrote
in message ...
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


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default FileDialog question

Perfect thanks!

"Elceller in distress" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
FileDialog Mike Archer Excel Programming 0 May 28th 06 06:31 PM
FileDialog Box Question Paul Excel Programming 0 May 8th 06 02:00 PM
using a filedialog box from a dll Paul Excel Programming 2 April 26th 06 04:56 PM
filedialog Norm Excel Worksheet Functions 0 July 29th 05 10:17 PM


All times are GMT +1. The time now is 02:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"