Send workbook as email attachment

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.

CodeFunctionName
What is this?

Public

Tested

Original Work
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

ToAddresses, sSubject, Optional WB = "This"

Views 172

Downloads 38

CodeID
DB ID

ANmarAmdeen
604
Attachments
Revisions

v2.0

Wednesday
February
14
2024