Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.
Sub ReportsSend() 'Application.ScreenUpdating = False 'Application.DisplayAlerts = False Sheets("mailer").Select Range("ReportBody").Select Dim MailToAddress As String MailToAddress = Range("ReportTo").Value Dim MailCcAddress As String MailCcAddress = Range("ReportCc").Value Dim MailSubject As String MailSubject = Range("ReportSubject").Value Dim ReportAttachment1 As String Dim ReportAttachment2 As String ReportAttachment1 = Range("Report1").Value ReportAttachment2 = Range("Report2").Value ' Show the envelope on the ActiveWorkbook. ActiveWorkbook.EnvelopeVisible = True ' Set the optional introduction field thats adds ' some header text to the email body. It also sets ' the To and Subject lines. Finally the message ' is sent. With ActiveSheet.MailEnvelope .Item.To = MailToAddress .Item.CC = MailCcAddress .Item.Subject = MailSubject .Item.Attachments.Add ReportAttachment1 .Item.Attachments.Add ReportAttachment2 .Item.Send End With End Sub
Join the community of 500,000 technology professionals and ask your questions.