The following assigns the file a name and then asks user to select the folder in should be save in.
I want the file to save and close after they select the folder but it is giving the user the opportunity to save it.
Also - if possible - I would like for the screen, after the file is saved and closed to be the folder in which the file was saved.00000000
That possible??
Sub SaveAnyFile()
MsgBox "Next you will see the file name assigned to this payment, Following that you will be asked to select the lien folder of the Job Folder to which this invoice pertains."
Dim folder, name As String
On Error Resume Next
name = Sheet1.Range("C11").Value & " - " & Sheet1.Range("C13").Value & " - " & Sheet1.Range("C18").Value & ".xlsm"
MsgBox name
With Application.FileDialog(msoFileDialogFolderPicker)
.Title = "Please select a folder"
.AllowMultiSelect = False
.Show
folder = .SelectedItems(1)
End With
name = Application.GetSaveAsFilename(InitialFileName:=folder & "\" & name, FileFilter:="Macro Enabled Workbook (*.xlsm), *.xlsm", Title:="Save As File")
ActiveWorkbook.SaveAs Filename:=name, FileFormat:=xlOpenXMLWorkbookMacroEnabled
ActiveWorkbook.Close
End Sub
Bookmarks