Hello All.
Each month, I run a macro that creates multiple tabs for a number of companies. Each tab corresponds to a general ledger entry for that company. After I run that macro and print paper copies of the entries (audit requirement), I run another macro that creates text files of the tab entries and saves them to a shared network drive (text files are required for general ledger upload to our SAP system).
Since the text files are named the same for each month, when the macro runs, a separate dialog window for each company opens up indicating that the file being saved already exists and do I want to overlay it with the new file data. I have to click Yes for each company.
My question is, is there a way to code my macro to automatically say yes to the overlay, so I no longer have to click Yes for a number of different companies?
Thank you in advance for any insights that can be provided.
Here is the code for creating and saving the text files:
ChDir "S:\"
Sheets("A000").Select
ActiveWorkbook.SaveAs Filename:="S:\ME A000.txt", FileFormat:=xlText, _
CreateBackup:=False
Sheets(" CA07 ").Select
ActiveWorkbook.SaveAs Filename:="S:\ME CA07.txt", FileFormat:=xlText, _
CreateBackup:=False
Sheets("CA13").Select
ActiveWorkbook.SaveAs Filename:="S:\ME CA13.txt", FileFormat:=xlText, _
CreateBackup:=False
Sheets("DE03").Select
ActiveWorkbook.SaveAs Filename:="S:\ME DE03.txt", FileFormat:=xlText, _
CreateBackup:=False
Sheets("DE12").Select
ActiveWorkbook.SaveAs Filename:="S:\ME DE12.txt", FileFormat:=xlText, _
CreateBackup:=False
Sheets("MN04").Select
ActiveWorkbook.SaveAs Filename:="S:\ME MN04.txt", FileFormat:=xlText, _
CreateBackup:=False
Sheets("MN07").Select
ActiveWorkbook.SaveAs Filename:="S:\ME MN07.txt", FileFormat:=xlText, _
CreateBackup:=False
Sheets("MN12").Select
ActiveWorkbook.SaveAs Filename:="S:\ME MN12.txt", FileFormat:=xlText, _
CreateBackup:=False
Sheets("TN02").Select
ActiveWorkbook.SaveAs Filename:="S:\ME TN02.txt", FileFormat:=xlText, _
CreateBackup:=False
Sheets("TX05").Select
ActiveWorkbook.SaveAs Filename:="S:\ME TX05.txt", FileFormat:=xlText, _
CreateBackup:=False
Sheets("WA02").Select
ActiveWorkbook.SaveAs Filename:="S:\ME WA02.txt", FileFormat:=xlText, _
CreateBackup:=False
Sheets("CT02").Select
ActiveWorkbook.SaveAs Filename:="S:\ME CT02.txt", FileFormat:=xlText, _
CreateBackup:=False
Sheets("MN06").Select
ActiveWorkbook.SaveAs Filename:="S:\ME MN06.txt", FileFormat:=xlText, _
CreateBackup:=False
Each month, I run a macro that creates multiple tabs for a number of companies. Each tab corresponds to a general ledger entry for that company. After I run that macro and print paper copies of the entries (audit requirement), I run another macro that creates text files of the tab entries and saves them to a shared network drive (text files are required for general ledger upload to our SAP system).
Since the text files are named the same for each month, when the macro runs, a separate dialog window for each company opens up indicating that the file being saved already exists and do I want to overlay it with the new file data. I have to click Yes for each company.
My question is, is there a way to code my macro to automatically say yes to the overlay, so I no longer have to click Yes for a number of different companies?
Thank you in advance for any insights that can be provided.
Here is the code for creating and saving the text files:
ChDir "S:\"
Sheets("A000").Select
ActiveWorkbook.SaveAs Filename:="S:\ME A000.txt", FileFormat:=xlText, _
CreateBackup:=False
Sheets(" CA07 ").Select
ActiveWorkbook.SaveAs Filename:="S:\ME CA07.txt", FileFormat:=xlText, _
CreateBackup:=False
Sheets("CA13").Select
ActiveWorkbook.SaveAs Filename:="S:\ME CA13.txt", FileFormat:=xlText, _
CreateBackup:=False
Sheets("DE03").Select
ActiveWorkbook.SaveAs Filename:="S:\ME DE03.txt", FileFormat:=xlText, _
CreateBackup:=False
Sheets("DE12").Select
ActiveWorkbook.SaveAs Filename:="S:\ME DE12.txt", FileFormat:=xlText, _
CreateBackup:=False
Sheets("MN04").Select
ActiveWorkbook.SaveAs Filename:="S:\ME MN04.txt", FileFormat:=xlText, _
CreateBackup:=False
Sheets("MN07").Select
ActiveWorkbook.SaveAs Filename:="S:\ME MN07.txt", FileFormat:=xlText, _
CreateBackup:=False
Sheets("MN12").Select
ActiveWorkbook.SaveAs Filename:="S:\ME MN12.txt", FileFormat:=xlText, _
CreateBackup:=False
Sheets("TN02").Select
ActiveWorkbook.SaveAs Filename:="S:\ME TN02.txt", FileFormat:=xlText, _
CreateBackup:=False
Sheets("TX05").Select
ActiveWorkbook.SaveAs Filename:="S:\ME TX05.txt", FileFormat:=xlText, _
CreateBackup:=False
Sheets("WA02").Select
ActiveWorkbook.SaveAs Filename:="S:\ME WA02.txt", FileFormat:=xlText, _
CreateBackup:=False
Sheets("CT02").Select
ActiveWorkbook.SaveAs Filename:="S:\ME CT02.txt", FileFormat:=xlText, _
CreateBackup:=False
Sheets("MN06").Select
ActiveWorkbook.SaveAs Filename:="S:\ME MN06.txt", FileFormat:=xlText, _
CreateBackup:=False