Eliminating save message

  • Thread starter Thread starter Paul
  • Start date Start date
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?
 
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
 
Paul

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

Regards

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top