LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 152
Default SaveCopyAs with a twist

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple Arguments - New Twist dansargeant Excel Worksheet Functions 2 March 10th 06 03:28 PM
Twist on the variable rate problem [email protected] Excel Worksheet Functions 0 January 23rd 06 10:41 AM
Siple formula with a twist Mike Busch Excel Discussion (Misc queries) 1 August 30th 05 05:06 PM
Sumif with a twist? Bruce Excel Worksheet Functions 1 August 16th 05 10:57 PM
Sorting by Date (With a Twist) B. Baumgartner Excel Discussion (Misc queries) 2 August 5th 05 02:20 AM


All times are GMT +1. The time now is 07:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"