Does this work any better?
Sub test()
Dim OutApp As Object
Dim ws As Worksheet
Dim row_count As Long, col_count As Long, i As Long, j As Long
Dim p As String, strbody As String
Set ws = ThisWorkbook.Sheets("Sheet1")
With ws
row_count = .Cells(Rows.Count, 1).End(xlUp).Row
col_count = .Cells(1, Columns.Count).End(xlToLeft).Column
End With
If row_count = 1 Then Exit Sub
Set OutApp = CreateObject("Outlook.Application")
For i = 2 To row_count
strbody = "<Body style = font-size:12pts, font-family:arial>" & _
"Dear " & ws.Cells(i, 8).Text & "," & _
"<BR><BR>Please find your ######## Report attached." & _
"<BR><BR>Regards<BR><BR>Mr #####<BR><BR>" & _
"##### #######"
With OutApp.createitem(0)
.To = ws.Cells(i, 1).Value
.Subject = ws.Cells(i, 2).Value
.Sentonbehalfofname = "##################"
.Display
.HTMLBody = strbody & .HTMLBody
For j = 3 To col_count
p = ws.Cells(i, j).Value
If Len(p) Then
If Dir(p) <> "" Then .attachments.Add p
End If
Next
End With
DoEvents
Next i
Set OutApp = Nothing
End Sub
Bookmarks