bluefeather8989
Active Member
- Joined
- Nov 20, 2009
- Messages
- 325
- Office Version
- 365
- Platform
- Windows
I have this marco to save a backup copy to another file. The computer asks me if i want to copy over the same file name. if I say "no" or "cancel " the marco trips up (run-time error 1004). how can i prevent this? Is there a way to make marco run the ok button instead of me having to press it every time?
VBA Code:
ChDir "C:\Users\bluef\OneDrive\Desktop\Excel\Tv shows"
ActiveWorkbook.SaveAs Filename:= _
"C:\Users\bluef\OneDrive\Desktop\Excel\Tv shows\TV Shows.xlsm", FileFormat:= _
xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False