Jimmy59601
New Member
- Joined
- Sep 21, 2017
- Messages
- 7
I used the Record Macro feature in Excel 2013 to create a macro to do a Save as of a workbook to another file. However, the macro stops at the point where I'm prompted to replace the existing file, where I would click "yes." I copied the code below, and perhaps someone can tell me how to make the macro enter "yes" and then exit Excel. I want to save a file named z-Bank.xlsx as x-Bank.xlsx Thanks!
Sub SaveAS()
'
' SaveAS Macro
'
' Keyboard Shortcut: Ctrl+s
'
ChDir "W:"
ActiveWorkbook.SaveAS Filename:="W:\x-Bank.xlsx", FileFormat:= _
xlOpenXMLWorkbook, CreateBackup:=False
End Sub
Sub SaveAS()
'
' SaveAS Macro
'
' Keyboard Shortcut: Ctrl+s
'
ChDir "W:"
ActiveWorkbook.SaveAS Filename:="W:\x-Bank.xlsx", FileFormat:= _
xlOpenXMLWorkbook, CreateBackup:=False
End Sub