Hi,
I know how to test a defined variable, but for the life of me I can't figure out how to test whether a user follows through the SaveAs prompt that I'm calling below:
If they don't actually save the file, I want it to exit the sub. Is there a way to set a variable to test based on whether or not they save?
Thanks!
I know how to test a defined variable, but for the life of me I can't figure out how to test whether a user follows through the SaveAs prompt that I'm calling below:
Code:
[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=If]#If[/URL] Mac Then
MsgBox "Please save the file somewhere it can easily be found, such as your desktop. You must save the file as a ""Macro-enabled Worksheet(.xlsm)"" file type, otherwise it will be unreadable."
Name = Application.GetSaveAsFilename(InitialFileName:=Worksheets("HR Use Only").Range("B7").Value & "_" & Worksheets("Hr Use Only").Range("B4").Value & "_" & Worksheets("ConditionalFormat").Range("E18").Value & "_PAF Draft_" & Format(Worksheets("HR Use Only").Range("D5").Value, "mm-dd-yyyy"))
[COLOR=#0000ff] ThisWorkbook.SaveCopyAs Filename:=Name[/COLOR]
MsgBox "Once you close this message, an email will be created in Outlook. Please attach the file you just saved to this email and press send."
ThisWorkbook.FollowHyperlink (Worksheets("MacLink").Range("B8"))
MsgBox "The email has been created. If you do not see the email, please check your Outlook application in your dock."
[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=Else]#Else[/URL]
'removed to be concise
If they don't actually save the file, I want it to exit the sub. Is there a way to set a variable to test based on whether or not they save?
Thanks!