Excel 2010
I'm using the following code to save the workbook in two places.
However, the code is erroring out. What am I doing wrong?
Thanks in advance.
I'm using the following code to save the workbook in two places.
Code:
Option Explicit
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Application.DisplayAlerts = False
'SAVES FILE USING THE VARIABLE BOOKNAME AS FILENAME
ActiveWorkbook.SaveAs Filename:="Location A\filename.xlsm", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
, CreateBackup:=False
ActiveWorkbook.SaveAs Filename:="Location B\filename.xlsm", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
, CreateBackup:=False
Application.DisplayAlerts = True
End Sub
However, the code is erroring out. What am I doing wrong?
Thanks in advance.