Re: SaveAs defaults...
- From: "Tom Ogilvy" <twogilvy@xxxxxxx>
- Date: Thu, 30 Jun 2005 12:21:23 -0400
If you want to not overwrite the file, then test for its existence and do
not execute the save
Logfile = "filename.xls"
if Dir(curdir() & "\" & logfile) = "" then
ActiveWorkbook.SaveAs Filename:=CurDir() & "\" & Logfile,
Else
msgbox "File conflict"
End if
--
Regards,
Tom Ogilvy
"John Keith" <JohnKeith@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:C5A03008-1455-4301-A874-C6C8916833B0@xxxxxxxxxxxxxxxx
> Using this code to save when the file already exists...
>
> Logfile = "filename.xls"
> Application.DisplayAlerts = False
> ActiveWorkbook.SaveAs Filename:=CurDir() & "\" & Logfile,
> ConflictResolution:=xlLocalSessionChanges
> Application.DisplayAlerts = True
>
> How do you know which default (yes|no) is taken to the overwrite message?
> I assume from all the posts I have seen on this topic that the "yes"
default
> is taken, but what if you wanted the "no" option taken?
>
> The parm for "ConflictResolution" seems like that should handle it, but
the
> options shown in the help files do not cover this.
>
> --
> Regards,
> John
.
- References:
- SaveAs defaults...
- From: John Keith
- SaveAs defaults...
- Prev by Date: Re: Calling sub routines
- Next by Date: TO Bug or Not TO Bug? That is the question.
- Previous by thread: SaveAs defaults...
- Next by thread: ComboBox in a Userforn to display a column...
- Index(es):
Relevant Pages
|