Excel VB Attachment available or not and Email sending Log
i want to create msg box if attachment not available and don't send that mail proceed to next mail after that same workbook write log whom to send subject and date .
im very new to VBA pls help
Sub Mail()
On Error Resume Next
Dim o As Object
Set o = CreateObject("Outlook.Application")
Dim omail As Object
Set omail = CreateObject("Outlook.MailItem")
Dim i As Long
For i = 2 To Range("a3000").End(xlUp).Row
Set omail = o.CreateItem(olMailItem)
With omail
Dim mysig As String
mysig =
Dim mysig1 As String
mysig1 =
.body = "
.to = Cells(i, 17).Value
.Subject = " -" & Cells(i, 1).Value
.Attachments.Add Cells(i, 30).Value
omail.SentOnBehalfOfName = ""
.send
End With
Next
End Sub