I have an excel sheet that i want to store a backup anytime someone closes it. I have used this code but every time i hit save it puts it in the folder 2020 Internal External Postings & Database instead of going one more step and putting it the test folder. Which i will rename to back up. Not a a coding person so any help would be appreciated. This is also in a shared (Legacy ) Workbook.
VBA Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
'Saves the current file to a backup folder and the default folder
'Note that any backup is overwritten
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs Filename:="W:\Job Posting Spreadsheet - Excel\2020 Internal External Postings & Database\test"
ActiveWorkbook.Name
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub