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

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
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,386
Messages
6,119,215
Members
448,874
Latest member
b1step2far

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