I have a somewhat "thrown together" spreadsheet which includes the following macro:
Sub IBEP()
Sheets(1).Copy
ActiveWorkbook.SendMail Recipients:="xxxxx@xxxxxx", Subject:="xxxxxxxxxxxxxx"
ActiveWorkbook.Close
MsgBox ("Thank you - Your form has now been sent. There is no need to send again as an attachment.") '
End Sub
The idea here is that one sheet within a spreadsheet document is copied and mailed off and the new document 'Book1' is closed. All works well except you get the inevitable messagebox asking whether or not you want to save Book1. Once this is up and running properly I'd rather the users didn't havcee the option to save Book 1 and it was always gotten rid of automatically. Does anyone have a solution?
Sub IBEP()
Sheets(1).Copy
ActiveWorkbook.SendMail Recipients:="xxxxx@xxxxxx", Subject:="xxxxxxxxxxxxxx"
ActiveWorkbook.Close
MsgBox ("Thank you - Your form has now been sent. There is no need to send again as an attachment.") '
End Sub
The idea here is that one sheet within a spreadsheet document is copied and mailed off and the new document 'Book1' is closed. All works well except you get the inevitable messagebox asking whether or not you want to save Book1. Once this is up and running properly I'd rather the users didn't havcee the option to save Book 1 and it was always gotten rid of automatically. Does anyone have a solution?