code to skip excel save as overwrite prompt

bisetti

Board Regular
Joined
Jun 16, 2003
Messages
216
I have a code that uses savas to back up a file. first it saves it then it does a save as to back it up. however i dont want a new file every time its saved. i just want to save as a certain name and write over it each time. is there a way to avoid the prompt that says a file with that name already exsists do you wish to overwrite it?
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Application.DisplayAlerts = False
' Your save code
Application.DiplayAlerts = True

Should take care of it for you.

HTH,

Smitty
 
Upvote 0
Here is the code I put that into:

ActiveWorkbook.Save
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs FileName:=Range("B299")
Application.DiplayAlerts = True

And this is what I get:

Run time error '438'
Object doesnt support this property or method

It them hilights the line:

Application.DiplayAlerts = True


Any suggestions?
 
Upvote 0
Yup...My bad spelling is to blame...

Application.DiplayAlerts = True

Should be:

Application.DisplayAlerts = True
 
Upvote 0

Forum statistics

Threads
1,214,654
Messages
6,120,758
Members
448,991
Latest member
Hanakoro

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top