ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   dumb question (https://www.excelbanter.com/excel-programming/286190-dumb-question.html)

john m

dumb question
 
hello,

how to set the default path that the filedialog looks at?

i see an application default path but i cant seem to set it. and the file
dialog object doesnt seem to have that property

thanks for any hint

jm



Dave Peterson[_3_]

dumb question
 
Just keep track of where you are, change to where you want to be, show the
dialog and set it back to where you we

(Most of this was stolen from the help for .filedialog)

Option Explicit
Sub testme()

Dim lngCount As Long
Dim curFolder As String
Dim newFolder As String

curFolder = CurDir
newFolder = "C:\test"

ChDrive newFolder
ChDir newFolder

' Open the file dialog
With Application.FileDialog(msoFileDialogOpen)
.AllowMultiSelect = True
.Show

' Display paths of each file selected
For lngCount = 1 To .SelectedItems.Count
MsgBox .SelectedItems(lngCount)
Next lngCount

End With

ChDrive curFolder
ChDir curFolder

End Sub




john m wrote:

hello,

how to set the default path that the filedialog looks at?

i see an application default path but i cant seem to set it. and the file
dialog object doesnt seem to have that property

thanks for any hint

jm


--

Dave Peterson


Otto Moehrbach[_6_]

dumb question
 
John
Click on Tools - Options - General tab. Look for "Default file
location:" Put the entire path to the folder you want. HTH Otto
"john m" wrote in message
...
hello,

how to set the default path that the filedialog looks at?

i see an application default path but i cant seem to set it. and the file
dialog object doesnt seem to have that property

thanks for any hint

jm






All times are GMT +1. The time now is 08:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com