Try This variation to your code
Private Sub Workbook_Open()
Dim i As Variant
Dim OutApp, OutMail As Object
Dim strto, strcc, strbcc, strsub, strbody As String
Dim today As Date
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
today = Date
For i = 3 To Range("C65536").End(xlUp).Row
' If Cells(i, 43) <> "Y" Then
If (Cells(i, 3) - 30) < today Then
strto = Cells(i, 4).Value 'email address
strsub = "PSR Contractor - Due date " & Cells(i, 3).Value 'email subject
strbody = "Dear " & Cells(i, 2).Value & vbNewLine & "please update your project status" 'email body
With OutMail
.To = strto
.Subject = strsub
.Body = strbody
.Send
' .display
End With
On Error Resume Next
Cells(i, 5) = "Mail Sent " & Now()
'Cells(i, ) = "Y"
End If
'End If
Next
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Bookmarks