I have carried out the process described in faq 707-4334 to send an e-mail from Excel without prompts. In about 1 in 10 (sometimes up to 1 in 20) occasions the e-mail fails to send and leaves an unsent mailitem on the desktop which is rather annoying and not especially robust.
Does anybody have any idea why this might be and how to cure it?
This is the relevant code:
ElseIf [h28] <> "" Then
With objMail
.To = "Middle Office"
.Subject = "Trade: " & [h28] & " " & [d7] & " " & [h31]
.Body = ""
.Display
End With
End If
SendKeys "%{s}", True
Set objMail = Nothing
Many thanks in advance
Does anybody have any idea why this might be and how to cure it?
This is the relevant code:
ElseIf [h28] <> "" Then
With objMail
.To = "Middle Office"
.Subject = "Trade: " & [h28] & " " & [d7] & " " & [h31]
.Body = ""
.Display
End With
End If
SendKeys "%{s}", True
Set objMail = Nothing
Many thanks in advance