Re: SaveAs defaults...

Tech-Archive recommends: Speed Up your PC by fixing your registry



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


.



Relevant Pages

  • Re: replacing string in xml file
    ... if a meteor hits your CPU just after it started to overwrite the file. ... Best regards, ... Carsten Haese ...
    (comp.lang.python)
  • Re: How to set folder options in TD?
    ... This component may overwrite ... need to add the value at late FBA phase. ... > have verified that on my development system when I uncheck/check "Hide ... >> Regards, ...
    (microsoft.public.windowsxp.embedded)
  • Re: WebDAV & overwrite an existing task
    ... if you do a PROPPATCH on the same url as the old task, you will overwrite it... ... Best regards, ... Visit my website: http://www.infinitec.de ...
    (microsoft.public.exchange2000.development)
  • Re: Save file queries
    ... Loop while True ... Regards, ... Tom Ogilvy ... > but i don't want to overwrite the file, ...
    (microsoft.public.excel.programming)