Link to home
Start Free TrialLog in
Avatar of mato01
mato01Flag for United States of America

asked on

Save file with date and new name

Need help on why I'm getting a compile error that state "

The result of the file name should be like

10/26/11 DWW NNNNN ABC#11111

Any thoughts?

Sub SaveWeeklyConstraintFile()
Application.DisplayAlerts = False

Workbooks.Open Filename:="C:\Users\abcde\Documents\Constraint File Upload\MM-DD-YY Weekly Dealer Constraints.xlsx"
ActiveWorkbook.SaveAs Filename:= _
"C:\Users\abcde\Documents\Constraint File Upload\Format(Now(), "mmm-dd-yyyy")" & "DWW NNNNN ABC#11111", FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False

ActiveWorkbook.Close False
'Call Workbook_Close
End Sub
ASKER CERTIFIED SOLUTION
Avatar of Saqib Husain
Saqib Husain
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial