Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Celtic_Avenger,
In addition to Tom's code amendments, a small suggestion: replace End with Exit Sub in your line: If LockOut = vbNo Then End An analogous change was effected by Tom when he revised a later portion of your code. Unlike Exit Sub, End has the effect of resetting module level variables and static local variables. --- Regards, Norman "Tom Ogilvy" wrote in message ... Private Sub SaveLockout() Dim LockOut LockOut = MsgBox("Are You Sure You Wish To Create Your Lockout Request At This Time?", vbYesNo, "DAILY DRAT") If LockOut = vbNo Then End Sheets("Lockout").Select Sheets("Lockout").Copy ActiveWindow.DisplayHeadings = False Dim fn As Variant fn = Application.GetSaveAsFilename(InitialFileName:=Wor ksheets("Lockout").Range(" J2").Value, _ FileFilter:="Excel Files (*.xls), *.xls", _ Title:="Save This Lockout Request Into Your Lockouts Folder! Do Not Change The File Name Shown!") If TypeName(fn) = "Boolean" Then ActiveWorkbook.close SaveChanges:=False msgbox "Cancelled" exit sub End if ActiveWorkbook.SaveAs fn ActiveWorkbook.Close False ActiveWorkbook.Sheets("Dispatch").Select MsgBox "Your Lockout Request Has Been Saved And Closed." & Chr(13) & "Please Email To Your District Manager For Processing!" End Sub -- Regards, Tom Ogilvy |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
"this operation has been canceled due to restrictions in effect on | Excel Discussion (Misc queries) | |||
how to save a desired window size but hv window comeup fullsz by d | Excel Discussion (Misc queries) | |||
Disabling SaveAs and Save? | Excel Discussion (Misc queries) | |||
Detecting Save vs SaveAs in BeforeSave | Excel Programming | |||
How to call File Open / Save Window in a Macro | Excel Programming |