Share via

Access Folder picker save location

Anonymous
2018-04-06T15:16:43+00:00

Good morning. Below is an example of my code, I'm trying to get my exported files to be saved in the location I select in the dialog box.

Sadly for some reason the files are saving in the parent folder instead of the folder I'm selecting.

 Dim vFile As String

 With Application.FileDialog(msoFileDialogFolderPicker) 'open Dialog box to select where to save files

         .Title = "Select Folder to Export"

          If .Show Then

             vFile = .SelectedItems(1)

        End If

     End With

'more code here

With xlBook

    .SaveAs FileName:=vFile & FacName

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2018-04-06T17:01:10+00:00

Never mind, made it work with the following:

 Dim vFile As String

 With Application.FileDialog(msoFileDialogFolderPicker) 'open Dialog box to select where to save files

         .Title = "Select Folder to Export"

          If .Show Then

             vFile = .SelectedItems(1) & ""

         End If

     End With

'more code here

With xlBook

    .SaveAs FileName:=vFile & FacName

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

0 additional answers

Sort by: Most helpful