Hi
I have created a VBA to send emails from Excel with Outlook.
My question: is there a way to create a message in cell to state if that email is sent?
I am sending 120+ emails
Thanks
Mark
Hi
I have created a VBA to send emails from Excel with Outlook.
My question: is there a way to create a message in cell to state if that email is sent?
I am sending 120+ emails
Thanks
Mark
Mark
Take a look at this Microsoft document: Err object. If there's an error in sending one of your 120+ emails, you can use Resume Next and modify the code given in that article to keep looping through/ sending your other emails:
Dim Msg
' If an error occurs, construct an error message
On Error Resume Next ' Defer error handling.
Err.Clear
Err.Raise 6 ' Generate an "Overflow" error.
' Check for error, then show message.
If Err.Number <> 0 Then
Msg = "Error # " & Str(Err.Number) & " was generated by " _
& Err.Source & Chr(13) & Chr(13) & Err.Description
MsgBox Msg, vbMsgBoxHelpButton, "Error", Err.Helpfile, Err.HelpContext
End If
but instead of the MsgBox line, write Msg to your cell.
REVISION
Please check sheet 184-Anneli Piir; looks like it fails your third-level IF test:
f Not IsError(traderName) And Not IsError(traderEmail) Then
because cell B1 says 184 rather than '184.
Hope this helps.