Suppress error message with saveas

  • Thread starter lisamariechemistry
  • Start date
L

lisamariechemistry

In one particular section of my module, I'd like to perform a
workbook.saveas that will:

1.) suppress the "file already exists" error message (I can do that
with OnError..) 2.) always go ahead and save over the existing file
(how?)

(I saw someone had asked about a related situation, using On Error
GoTo 0 to move on to the next task instead of overwriting the existing
file...close but doesn't quite get me there) Help?
 
P

PCLIVE

Maybe this:

Application.AlertBeforeOverwriting = False
Application.AlertBeforeOverwriting = True

HTH,
Paul
 
D

Dave Peterson

You can use something like:

Application.displayalerts = false
'your code to save the workbook here
application.displayalerts = true

to suppress that warning dialog.
 
G

Guest

Hi,

Try it this way

Application.DisplayAlerts = False
ThisWorkbook.SaveAs "C:\sample.xls"
Application.DisplayAlerts = True
 
L

lisamariechemistry

Thank you, thank you, and thank you!

You can use something like:

Application.displayalerts = false
'your code to save the workbook here
application.displayalerts = true

to suppress that warning dialog.
 

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

Top