davidfrazier
New Member
- Joined
- Mar 1, 2018
- Messages
- 3
Hey guys,
I've worked hard to build a spreadsheet for ordering print job. It calculates cost, allows a file to be attached, and emails to our shop however, once it sends the email it reboots excel. Not sure why it does it but it always does. This is my VBS code that is attached to a button. It checks to ensure C38 has data if not it sends a message, if data is present it sends email. I've stripped everything out of it minus the " ActiveWorkbook.SendMail Recipients:="abody@somewhere.com" portion and it still reboots.
Private Sub CommandButton2_Click()
If Range("C38").Value = "" Then
'Message Box with just prompt message
MsgBox ("Chief Approval Required")
Wscript.Quit
End If
ActiveWorkbook.SendMail Recipients:="abody@somewhere.com"
'Message Box with just prompt message
MsgBox ("Thank you for your order")
Workbooks("PrintRequestClean_2_23_18.XLSM").Close SaveChanges:=False
End Sub
Thanks for any advice
David
I've worked hard to build a spreadsheet for ordering print job. It calculates cost, allows a file to be attached, and emails to our shop however, once it sends the email it reboots excel. Not sure why it does it but it always does. This is my VBS code that is attached to a button. It checks to ensure C38 has data if not it sends a message, if data is present it sends email. I've stripped everything out of it minus the " ActiveWorkbook.SendMail Recipients:="abody@somewhere.com" portion and it still reboots.
Private Sub CommandButton2_Click()
If Range("C38").Value = "" Then
'Message Box with just prompt message
MsgBox ("Chief Approval Required")
Wscript.Quit
End If
ActiveWorkbook.SendMail Recipients:="abody@somewhere.com"
'Message Box with just prompt message
MsgBox ("Thank you for your order")
Workbooks("PrintRequestClean_2_23_18.XLSM").Close SaveChanges:=False
End Sub
Thanks for any advice
David
Last edited by a moderator: