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?