Send Email Vba With Attachment. Next thing is we need to mention the subject for the email we are sending. Please insert a command button by clicking developer insert command button activex control.
Dim destinwb as workbook. Sub emailworkbook purpose. Email activeworkbook as outlook attachment.
Dim sourcewb as workbook.
Use comma for multiple email ids. Massage in massage body column. Here we are sending mail to multiple recipients and also attaching a file from local drive we have also added the text for body in the mail. Sub send email fromexcel dim edress as string dim subj as string dim message as string dim filename as string dim outlookapp as object dim outlookmailitem as object dim myattachments as object dim path as string dim lastcol as integer dim attachment as string dim x as integer x 2 do while sheet7 cells 2 x set outlookapp createobject outlook application set outlookmailitem outlookapp createitem 0 set myattachments outlookmailitem attachments path sheet7 cells 5 x.