Retro way to send a workbook you are in as an email.
Found it in one of my old archives and thought to share it.
Excel (Or Outlook) will show message to user before sending, this is not the way to automate sending.
Function SendMeWorkbook(ToAddresses, sSubject, Optional WB = "This")
Rett = 0
If WB = "This" Then WB = ThisWorkbook.Name
If WB = "Active" Then WB = ActiveWorkbook.Name
Workbooks(WB).SendMail ToAddresses, sSubject , Rett
' ActiveWorkbook.SendMail "excel@vba.me", "Hi there from Excel", Rett5
SendMeWorkbook = Rett
' MsgBox Rett5
End Function
Rett = 0
If WB = "This" Then WB = ThisWorkbook.Name
If WB = "Active" Then WB = ActiveWorkbook.Name
Workbooks(WB).SendMail ToAddresses, sSubject , Rett
' ActiveWorkbook.SendMail "excel@vba.me", "Hi there from Excel", Rett5
SendMeWorkbook = Rett
' MsgBox Rett5
End Function
ToAddresses, sSubject, Optional WB = "This"
Views 183
Downloads 41
CodeID
DB ID