Hi,
I using the code below but getting this error "Path does not exist, check the path and try again" another question how get it save the file with name based on cell name.
here is the code:
Thank you,
I using the code below but getting this error "Path does not exist, check the path and try again" another question how get it save the file with name based on cell name.
here is the code:
VBA Code:
Option Explicit
Sub ChooseFolder()
Dim dlgSaveFolder As FileDialog
Dim sFolderPathForSave As String
'''
'Open a Folder picker dialog box.
Set dlgSaveFolder = Application.FileDialog(msoFileDialogFolderPicker)
With dlgSaveFolder
.Title = "Select a Folder"
.AllowMultiSelect = False
.InitialFileName = ThisWorkbook.Path & "\"
If .Show <> -1 Then GoTo CancelFolderSelection
sFolderPathForSave = .SelectedItems(1)
End With
Set dlgSaveFolder = Nothing
'''
'File saving code goes here.
'''
CancelFolderSelection:
End Sub
Thank you,