B
blerman
I have created the following macro, which is supposed to save the file based
on values in specific cells and then exit Excel, but it needs to be modified
to not save the file if the users clicks on the cancel button in the SaveAs
dialog box. I am a novice when it comes to this so any assistance with
specific examples will be greatly appreciated.
Sub saveexit()
'
' saveexit1 Macro
' Macro recorded 03/31/2008 by Barry Lerman
'
'
With ActiveWindow
strDate = Range("d2")
strDate1 = Format(Range("L2"), "mm-dd-yy")
Application.Dialogs(xlDialogSaveAs).Show _
arg1:=ActiveWorkbook.Path & "\" & strDate & " - " & "PPE" & " " & strDate1 &
" " & "T&A Worksheet", arg2:=1
ActiveWorkbook.RunAutoMacros Which:=xlAutoClose
Application.Quit
ThisWorkbook.Close SaveChanges:=True
End With
End Sub
on values in specific cells and then exit Excel, but it needs to be modified
to not save the file if the users clicks on the cancel button in the SaveAs
dialog box. I am a novice when it comes to this so any assistance with
specific examples will be greatly appreciated.
Sub saveexit()
'
' saveexit1 Macro
' Macro recorded 03/31/2008 by Barry Lerman
'
'
With ActiveWindow
strDate = Range("d2")
strDate1 = Format(Range("L2"), "mm-dd-yy")
Application.Dialogs(xlDialogSaveAs).Show _
arg1:=ActiveWorkbook.Path & "\" & strDate & " - " & "PPE" & " " & strDate1 &
" " & "T&A Worksheet", arg2:=1
ActiveWorkbook.RunAutoMacros Which:=xlAutoClose
Application.Quit
ThisWorkbook.Close SaveChanges:=True
End With
End Sub