Without seeing your code, wouldn't be able to comment... maybe you're calling the dialog box twice? Maybe it's inside a loop? Maybe you have other code that's causing the second window to pop open?
Dim tDate As String
Dim FileSaveName As String
Dim fName As String
fName = ActiveWorkbook.FullName
tDate = VBA.Format(DateSerial(Year(Date), Month(Date), Day(Date)), "dd-mm-yyyy")
FileSaveName = Application.GetSaveAsFilename(InitialFileName:=fName, filefilter:="Excel Files(*.xlsm),*.xlsm", Title:="Please save the file")
With Application.FileDialog(msoFileDialogFolderPicker)
.AllowMultiSelect = False
.Show
ActiveWorkbook.SaveAs Filename:=fName & tDate & ".xlsm", FileFormat:=52
End With
fileSaveName = Application.GetSaveAsFilename(InitialFileName:=fname, filefilter:="Excel Files(*.xlsm),*.xlsm", Title:="Please save the file")
With Application.FileDialog(msoFileDialogFolderPicker)
Dim tDate As String
Dim FileSaveName As String
Dim fName As String
fName = ActiveWorkbook.FullName & "_" & Format(today, "DD-MM-YYYY")
FileSaveName = Application.GetSaveAsFilename(InitialFileName:=fName, filefilter:="Excel Files(*.xlsm),*.xlsm", Title:="Please save the file")
ActiveWorkbook.SaveAs FileName:=FileSaveName, FileFormat:=52
Parts in blue creates pop-up windows, your code is calling a pop-up window twice:
I think you can reduce your code to:Rich (BB code):fileSaveName = Application.GetSaveAsFilename(InitialFileName:=fname, filefilter:="Excel Files(*.xlsm),*.xlsm", Title:="Please save the file") With Application.FileDialog(msoFileDialogFolderPicker)
Rich (BB code):Dim tDate As String Dim FileSaveName As String Dim fName As String fName = ActiveWorkbook.FullName & "_" & Format(today, "DD-MM-YYYY") FileSaveName = Application.GetSaveAsFilename(InitialFileName:=fName, filefilter:="Excel Files(*.xlsm),*.xlsm", Title:="Please save the file") ActiveWorkbook.SaveAs FileName:=FileSaveName, FileFormat:=52
Dim tDate As String
Dim FileSaveName As String
Dim fName As String
fName = ActiveWorkbook.FullName & "_" & Format(today, "DD-MM-YYYY")
FileSaveName = Application.GetSaveAsFilename(InitialFileName:=fName, filefilter:="Excel Files(*.xlsm),*.xlsm", Title:="Please save the file")
if FileSaveName <> FALSE Then ActiveWorkbook.SaveAs FileName:=fName, FileFormat:=52
Untested (again!), try:
Rich (BB code):Dim tDate As String Dim FileSaveName As String Dim fName As String fName = ActiveWorkbook.FullName & "_" & Format(today, "DD-MM-YYYY") FileSaveName = Application.GetSaveAsFilename(InitialFileName:=fName, filefilter:="Excel Files(*.xlsm),*.xlsm", Title:="Please save the file") if FileSaveName <> FALSE Then ActiveWorkbook.SaveAs FileName:=fName, FileFormat:=52
if FileSaveName <> FALSE Then
Dim fName As String
fName = ActiveWorkbook.FullName & "_" & Format(today, "DD-MM-YYYY") & ".xlsm"
' FileSaveName = Application.GetSaveAsFilename(InitialFileName:=fName, filefilter:="Excel Files(*.xlsm),*.xlsm", Title:="Please save the file")
' If FileSaveName <> False Then ActiveWorkbook.SaveAs FileName:=fName, FileFormat:=52
ActiveWorkbook.SaveAs FileName:=fName, FileFormat:=52