> First, I don't think that this line actually works:
>
> ChDir "\\Server1\Netusers\Current Year"
>
> I've never seen ChDir work on a UNC path. But the good thing is you don't need
> to change drives/folders to save the file. You can just specify the path in the
> ..savecopyas line
>
>
> ActiveWorkbook.SaveCopyAs _
> Filename:=\\Server1\Netusers\Current Year\" & Range("BckUp").Text
>
>
>
> Rookie 1st class wrote:
> >
> > Current Code:
> >
> > Private Sub Workbook_BeforeClose(Cancel As Boolean)
> > 'On Close
> > Range("BckUp").Select
> > Application.ScreenUpdating = False
> > ActiveSheet.Unprotect
> > response = MsgBox(Prompt:="Would You Like to Create a Back-Up Copy?",
> > Buttons:=vbYesNoCancel + vbDefaultButton1, Title:="BACK-UP COPY")
> > If response = vbYes Then
> > BookName = ActiveWorkbook.Name
> > Selection = ClearContents
> > Selection = InputBox(Prompt:="Your Back-Up Form Name Will Be Like
> > the Window Below.", Title:="BACK-UP COPY", Default:=Range("BckUpDt").Text + "
> > " + (BookName))
> > If ActiveWorkbook.Saved = False Then ActiveWorkbook.SaveAs
> > On Error GoTo Oops
> > ChDir "\\Server1\Netusers\Current Year"
> > ActiveWorkbook.SaveCopyAs Filename:=Range("BckUp").Text
> > ActiveWorkbook.Saved = True
> > ChDir "\\Server1\Netusers\Lab"
> > Oops:
> > ChDir "\Current Year"
> > ActiveWorkbook.SaveCopyAs Filename:=Range("BckUp").Text
> > ActiveWorkbook.Saved = True
> > ChDir "\Pyro\Lab"
> > ElseIf response = vbCancel Then
> > Exit Sub
> > End If
> > ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
> > Application.ScreenUpdating = True
> > End Sub
> >
> > There are sub directories under "Lab". I Know I generate the change
> > directory. How can I do the same thing without the CD?
> > "Rookie 1st class" wrote:
> >
> > > Dave I did something similar on close, It adds the date to the file name and
> > > saves it in "//netusers*/Current Year". My problem is it leaves the program
> > > in the directory "*.Current Year" on exit. How do I remain in the current
> > > directory on exit?
> > >
> > > "Dave Peterson" wrote:
> > >
> > > > You could use a macro:
> > > >
> > > > option explicit
> > > > sub SaveTwice()
> > > > with activeworkbook
> > > > .save
> > > > .savecopyas "C:\mybackups\" & .name
> > > > end with
> > > > end sub
> > > >
> > > > Change the folder location to what you need.
> > > >
> > > > If you're new to macros, you may want to read David McRitchie's intro at:
> > > >
http://www.mvps.org/dmcritchie/excel/getstarted.htm> > > >
> > > > Saving a Backup every time wrote:
> > > > >
> > > > > I need to make a backup onto a server for every file I save. Is there a way
> > > > > I can have excel save 2 copies - one where I have access, and one in the
> > > > > backup file in my server?
> > > >
> > > > --
> > > >
> > > > Dave Peterson
> > > >
>
> --
>
> Dave Peterson
>