Eliminating save message

P

Paul

Hi-

I wrote a Macro to automatically save a sheet in a text
file output format. This is the code used:

Sheets("AccessTable").Select
Cells.Select
ActiveWorkbook.SaveAs Filename:="C:\Data\RV
Reserve\AccessTable.txt", _
FileFormat:=xlText, CreateBackup:=False

How can I stop Excel from asking if I want to replace the
existing saved file?
 
F

Frank Kabel

Hi
try
Sheets("AccessTable").Select
Cells.Select
application.displayalerts = false
ActiveWorkbook.SaveAs Filename:="C:\Data\RV
Reserve\AccessTable.txt", _
FileFormat:=xlText, CreateBackup:=False
application.displayalerts = True
 
T

Trevor Shuttleworth

Paul

Application.DisplayAlerts = False
' your code
Application.DisplayAlerts = True

Regards

Trevor
 
R

Rick

Enter Application.DisplayAlerts=False before the SaveAs
command, then Application.DisplayAlerts=True after.
 
Top