Re: Save as, not overwrite

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Suggest you remove:

Application.DisplayAlerts = False

The code *is* doing a Save As ... you just choose to allow it to overwrite
an existing file.

Regards

Trevor


"Carlee" <Carlee@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:AB1CED17-5803-400F-A2D2-F12428DB9CAC@xxxxxxxxxxxxxxxx
Hi there,

The following code saves the spreadsheet in question, overwriting any
existing with the same name, that is found on the Desktop.

Question:
How can i change this code such that it prompts me to Save As, rather than
overwrite?

Any help is appreciated greatly,

pathToUserDesktop = "C:\Documents and Settings\" & _
Get_Win_User_Name() & "\Desktop\" & newWorkbookName
'save new workbook, but don't nag
'user with "file exists" message
Application.DisplayAlerts = False
With Workbooks(destBook)
'renames it while saving it
'will overwrite existing file of same name
.SaveAs pathToUserDesktop
'close it
.Close
End With
Application.DisplayAlerts = True
Application.ScreenUpdating = True

--
Carlee


.



Relevant Pages

  • Re: Photos
    ... Finding replaced photos wrote: ... while saving. ... overwrite never occurred. ... This is not tech support ...
    (microsoft.public.windowsxp.photos)
  • Disabling the "Overwrite existing files" checkbox when saving a form
    ... I am running into a bit of trouble figuring out how to un-check the ... default "Overwrite Existing Files" check box in the Save window when ... saving a form with forms services on MOSS 2007. ...
    (microsoft.public.sharepoint.portalserver)
  • Re: Why mv have no -R
    ... 'mv' does not really move data(in one file system), it just renames ... if file2 already exists, ... So, in most cases, you will overwrite ...
    (comp.unix.shell)
  • Re: OT Techy Mouse help required
    ... Gumrat wrote: ... It lets the old version (which you overwrite by ... saving) survive with a different file name extension. ... there's little sense in having exactly one older copy floating around - ...
    (uk.media.radio.archers)
  • Tstrings
    ... Have managed to save some info to file however on saving a second time i ... don't add to the file i overwrite it any ideas?? ... with logfile do ...
    (alt.comp.lang.borland-delphi)