Hello, I am trying to send an attachment to 60 people. I have the 60 names on a tab named Email List to be updated as needed. When adding names to the to field I obtained the error message "To many line continuations". Is it possible to correct the below to send to all 60 email addresses?
Sub EmailFile2()
Dim olApp As Object
Dim olMail As Object
Dim olSubject As String
Dim ToField As String
' // Turn off screen updating
Application.ScreenUpdating = False
Set olApp = CreateObject("Outlook.Application")
Set olMail = olApp.CreateItem(olMailItem)
olSubject = "I will be returning your requests if the instructions below aren't followed. " & Format(Date, "MMMM yyyy")
With olMail
.Display
End With
With olMail
.To = ThisWorkbook.Sheets("Email List").Range("B1") & _
ThisWorkbook.Sheets("Email List").Range("B2") & _
ThisWorkbook.Sheets("Email List").Range("B3") & _
ThisWorkbook.Sheets("Email List").Range("B4") & _
ThisWorkbook.Sheets("Email List").Range("B5") & _
ThisWorkbook.Sheets("Email List").Range("B6") & _
ThisWorkbook.Sheets("Email List").Range("B7") & _
ThisWorkbook.Sheets("Email List").Range("B8") & _
ThisWorkbook.Sheets("Email List").Range("B9") & _
ThisWorkbook.Sheets("Email List").Range("B10") & _
ThisWorkbook.Sheets("Email List").Range("B11") & _
ThisWorkbook.Sheets("Email List").Range("B12") & _
ThisWorkbook.Sheets("Email List").Range("B13") & _
ThisWorkbook.Sheets("Email List").Range("B14") & _
ThisWorkbook.Sheets("Email List").Range("B15") & _
ThisWorkbook.Sheets("Email List").Range("B16") & _
ThisWorkbook.Sheets("Email List").Range("B17") & _
ThisWorkbook.Sheets("Email List").Range("B18") & _
ThisWorkbook.Sheets("Email List").Range("B19") & _
ThisWorkbook.Sheets("Email List").Range("B20") & _
ThisWorkbook.Sheets("Email List").Range("B21") & _
ThisWorkbook.Sheets("Email List").Range("B22") & _
ThisWorkbook.Sheets("Email List").Range("B23") & _
ThisWorkbook.Sheets("Email List").Range("B24") & _
ThisWorkbook.Sheets("Email List").Range("B25")
.CC = ""
.BCC = ""
.Subject = olSubject
.HTMLBody = "
REMINDER:
"& .HTMLBody
.Attachments.Add "ATTACHLOCATION.XLS"
.Display
End With
' // Restore screen updating
Application.ScreenUpdating = True
Set olMail = Nothing
Set olApp = Nothing
End Sub
Sub EmailFile2()
Dim olApp As Object
Dim olMail As Object
Dim olSubject As String
Dim ToField As String
' // Turn off screen updating
Application.ScreenUpdating = False
Set olApp = CreateObject("Outlook.Application")
Set olMail = olApp.CreateItem(olMailItem)
olSubject = "I will be returning your requests if the instructions below aren't followed. " & Format(Date, "MMMM yyyy")
With olMail
.Display
End With
With olMail
.To = ThisWorkbook.Sheets("Email List").Range("B1") & _
ThisWorkbook.Sheets("Email List").Range("B2") & _
ThisWorkbook.Sheets("Email List").Range("B3") & _
ThisWorkbook.Sheets("Email List").Range("B4") & _
ThisWorkbook.Sheets("Email List").Range("B5") & _
ThisWorkbook.Sheets("Email List").Range("B6") & _
ThisWorkbook.Sheets("Email List").Range("B7") & _
ThisWorkbook.Sheets("Email List").Range("B8") & _
ThisWorkbook.Sheets("Email List").Range("B9") & _
ThisWorkbook.Sheets("Email List").Range("B10") & _
ThisWorkbook.Sheets("Email List").Range("B11") & _
ThisWorkbook.Sheets("Email List").Range("B12") & _
ThisWorkbook.Sheets("Email List").Range("B13") & _
ThisWorkbook.Sheets("Email List").Range("B14") & _
ThisWorkbook.Sheets("Email List").Range("B15") & _
ThisWorkbook.Sheets("Email List").Range("B16") & _
ThisWorkbook.Sheets("Email List").Range("B17") & _
ThisWorkbook.Sheets("Email List").Range("B18") & _
ThisWorkbook.Sheets("Email List").Range("B19") & _
ThisWorkbook.Sheets("Email List").Range("B20") & _
ThisWorkbook.Sheets("Email List").Range("B21") & _
ThisWorkbook.Sheets("Email List").Range("B22") & _
ThisWorkbook.Sheets("Email List").Range("B23") & _
ThisWorkbook.Sheets("Email List").Range("B24") & _
ThisWorkbook.Sheets("Email List").Range("B25")
.CC = ""
.BCC = ""
.Subject = olSubject
.HTMLBody = "
REMINDER:
"& .HTMLBody
.Attachments.Add "ATTACHLOCATION.XLS"
.Display
End With
' // Restore screen updating
Application.ScreenUpdating = True
Set olMail = Nothing
Set olApp = Nothing
End Sub