tonywatsonhelp
Well-known Member
- Joined
- Feb 24, 2014
- Messages
- 3,194
- Office Version
- 365
- 2019
- 2016
- Platform
- Windows
Hi everyone,
This macro works great, but if there is already a file with the same name it dugs out,
i want it to just overwrite the file.
can this be done?
if so, lease update the attached.
thanks
Tony
my code
This macro works great, but if there is already a file with the same name it dugs out,
i want it to just overwrite the file.
can this be done?
if so, lease update the attached.
thanks
Tony
my code
VBA Code:
Sub Create_Report()
Call AA_Protect
Application.EnableEvents = False
Application.ScreenUpdating = False
Application.DisplayAlerts = False
myLoc = Application.ActiveWorkbook.Path
NewName = Range("O10")
ActiveSheet.Copy
ActiveWorkbook.SaveAs myLoc & "\" & NewName & ".xlsx"
MsgBox "Report Created"
Application.DisplayAlerts = True
Application.EnableEvents = True
Application.ScreenUpdating = True
Call AA_unProtect
End Sub