PDA

View Full Version : Solved: Save As and replace existing file



haddy27
05-31-2007, 07:11 AM
Hopefully this is a pretty straightforward one!

I am writing a macro that saves one worksheet of a workbook in a separate location once you calculate the source spreadsheet. The source spreadsheet can be re-run, but the macro stops to state:

A file named "filename and location" already exists in this location, do you want to replace it?"

Is there a line of code that just selects Yes to this pop up message as this will be the case every time this occurs?

Thanks

Bob Phillips
05-31-2007, 07:14 AM
Application.DisplayAlerts = False


and reset it afterwards

haddy27
05-31-2007, 07:18 AM
You're on the ball today xld!

Thanks for your help, erasonably new to VBA so it is appreciated.

Bob Phillips
05-31-2007, 07:40 AM
We all were once.