Try this.
![]()
Private Sub Workbook_Open() Dim mydir As String, Pfad As String, Tag As String With ActiveDocument With Application.FileDialog(msoFileDialogFolderPicker) .AllowMultiSelect = False .InitialFileName = "G:\Shareplan\test_31686\Plan\07\" If .Show <> -1 Then MsgBox "No folder selected! Exiting sub...": Exit Sub mydir = .SelectedItems(1) End With Pfad = mydir & "\" Tag = Format("yymmdd") Application.DisplayAlerts = False .SaveAs Pfad & "contrib_per_payroll_check_" & Tag Application.DisplayAlerts = True 'Application.GetSaveAsFilename .Close End With End Sub
Bookmarks