Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

activeworkbook.saveas -- overwrite without prompt 2

Status
Not open for further replies.

LisaBee

Technical User
Jun 23, 2006
18
US
Again, another probably simple solution that the syntax eludes me. (and I honestly don't know enough about VBA help to understand its options).

I'm using ActiveWorkbook.SaveAs FileName:=LocalFileName

There are a few ocassions when I know that the filename already exists, but after making modifications to the worksheet, I want to save over the existing file. How can this be done automatically, without prompting the user "file already exists, do you want to overwrite - yes, no, cancel"?

Thanks very much :)
 
Have a look at the DisplayAlerts property:
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs FileName:=LocalFileName
Application.DisplayAlerts = True

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Absolutely works perfectly!!!

Thanks so much! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top