View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
[email protected] b.engelbrecht@gmail.com is offline
external usenet poster
 
Posts: 4
Default Overwriting an existing Excel workbook

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