pre set folder path (1 Viewer)

kobiashi

Registered User.
Local time
Today, 13:57
Joined
May 11, 2018
Messages
258
hi

i have a function to open file dialog, how can i pre set the folder location

heres my code

Code:
Function selectFile()
    Dim fd As FileDialog
    Set fd = Application.FileDialog(msoFileDialogFilePicker)
    fd.AllowMultiSelect = False
    fd.Title = "Plase Select The Latest Run in."
    fd.Filters.Clear
    fd.Filters.Add "Excel Spreadsheet", "*.xls, *.xlxs"
       
    With fd
        If .Show Then
            selectFile = .SelectedItems(1)
        Else
            'stop execution if nothing selected
            End
        End If
    End With
 
    Set fd = Nothing
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 20:57
Joined
May 7, 2009
Messages
19,230
Code:
....
    With fd
        [COLOR="Navy"].InitialFileName="the path here"[/COLOR]
        If .Show Then
....
 

Users who are viewing this thread

Top Bottom