Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
The following worked until I had to add the second line (Oops) for laptops
away from the facility. It still functions properly but I get en error message. What is the correct to fix this problem? 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)) On Error GoTo Oops ActiveWorkbook.SaveCopyAs Filename:="\\Wizard\Emerald Calibrations\Current Year\" & Range("BckUp").Text Oops: ActiveWorkbook.SaveCopyAs Filename:="\Emerald Calibrations\Current Year\" & Range("BckUp").Text ElseIf Response = vbCancel Then Exit Sub End If ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True Application.ScreenUpdating = True ThisWorkbook.Saved = True End Sub TIA Lou |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Multiple Arguments - New Twist | Excel Worksheet Functions | |||
Twist on the variable rate problem | Excel Worksheet Functions | |||
Siple formula with a twist | Excel Discussion (Misc queries) | |||
Sumif with a twist? | Excel Worksheet Functions | |||
Sorting by Date (With a Twist) | Excel Discussion (Misc queries) |