Re: Overwriting an existing Excel workbook

Tech-Archive recommends: Fix windows errors by optimizing your registry



In Excel 2003 you need to set this before calling SaveAs:
DisplayAlerts = False
AlertBeforeOverwriting = False

In this Excel version, DisplayAlerts = False does not suppress the
overwrite warning. To make very sure that you are never prompted, it is
recommended that you also use the ConflictResolution parameter of
SaveAs, like this:

ActiveWorkbook.SaveAs Filename:="name to be used",
FileFormat:=xlNormal, ConflictResolution:=xlLocalSessionChanges

Best regards,

Berend


Dave Peterson schreef:

Do the "if yes" suggestion.

Jenni wrote:

Yes in my macro would be great but if that cannot be done I was hoping there
is a way for me to "turn off" that warning temporarily while I run my macro.

"Dave Peterson" wrote:

You mean in your macro?

If yes:

application.displayalerts = false
'your code to do .saveas
application.displayalerts = true

If you mean when you use file|saveas, I don't think so.

Jenni wrote:

When I "save as" and overwrite an existing workbook I get the prompt "are you
sure you want to overwrite" is there any way to not get that prompt? To just
overwrite without warning?

--

Dave Peterson


--

Dave Peterson

.



Relevant Pages

  • Re: DisplayAlerts
    ... > of displayalerts (with regard to SAVEAS using other than the default ... > choice) that you refer to was not documented in previous versions of ...
    (microsoft.public.excel.programming)
  • Re: savecopyas issues
    ... smokiibear wrote: ... the following snippet enables me to overwrite without and alert ... > I thought that I had some overwrite issues with the saveas in a previous ...
    (microsoft.public.excel.programming)
  • Re: Sound Forge 9 - was: Re: mic cable for headphone
    ... If you want to OVERWRITE an existing preset and do ... things that the machine should do, and as it DID DO before SaveAs was removed. ... You can make an argument to remove an obscure function from the UI, but removing ...
    (rec.audio.pro)
  • Re: Overwrite prompt
    ... If you have a document open, and you tell it to "SaveAs" and let Word ... because the overwrite warning is standard to all ... This message is posted to a newsgroup. ... prompt asking if I would like to overwrite that file. ...
    (microsoft.public.word.newusers)
  • Re: savecopyas issues
    ... the following snippet enables me to overwrite without and alert ... and save the csv to xls: ... I thought that I had some overwrite issues with the saveas in a previous ...
    (microsoft.public.excel.programming)