Auto Respond with "Yes" to File Overlay Dialog Win

AlanS

New Member
Joined
Jul 27, 2007
Messages
5
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
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Forum statistics

Threads
1,214,943
Messages
6,122,370
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top