Sub Demo()
SaveSansMacros Workbooks("name.xlsm")
End Sub
Sub SaveSansMacros(wkb As Workbook)
With wkb
If Not .Saved Then
MsgBox "File not saved. Save, then try again."
Else
.SaveAs Filename:=Left(.FullName, InStrRev(.FullName, ".")) & _
Format(Date, " yyyy-mm-dd") & "xlsx", _
FileFormat:=xlOpenXMLWorkbook
End If
End With
End Sub
Application.DisplayAlerts = False ' Suppress "SaveAs" dialog box
Application.EnableEvents = False ' Suppress BeforeSave event
wkOrdInWkBk.Save
Application.EnableEvents = True
Application.DisplayAlerts = True
Sub SaveSansMacros(wkb As Workbook)
Dim bDA As Boolean
With wkb
If Not .Saved Then
MsgBox "File not saved. Save, then try again."
Else
bDA = Application.DisplayAlerts
Application.DisplayAlerts = False
.SaveAs Filename:=Left(.FullName, InStrRev(.FullName, ".")) & _
Format(Date, " yyyy-mm-dd") & "xlsx", _
FileFormat:=xlOpenXMLWorkbook
Application.DisplayAlerts = bDA
End If
End With
End Sub