Buras
Buras

Reputation: 3099

How to disable warnings at saving?

I tried to save without warnings

ActiveWorkbook.SaveAs Filename:= _
        "C:\Users\Owner\Desktop\xxx\test.xlsx", _
        ConflictResolution:=xlLocalSessionChanges

But still getting this It is already exists do you want to replace thing

How can I save and replace without warnings ?

Upvotes: 2

Views: 3792

Answers (1)

sous2817
sous2817

Reputation: 3960

Try wrapping it in an Application.DisplayAlerts = false at the start and Application.DisplayAlerts = true at the end. Something like:

Application.DisplayAlerts = False

ActiveWorkbook.SaveAs Filename:= _
        "C:\Users\Owner\Desktop\xxx\test.xlsx", _
        ConflictResolution:=xlLocalSessionChanges

Application.DisplayAlerts= True

http://msdn.microsoft.com/en-us/library/office/ff839782(v=office.15).aspx

Upvotes: 10

Related Questions