Hello,
The code below works but only after the warning pops up. I get a critical warning pop up that says "No Such Template". Can anyone see why the warning pops up first then actually does what the macro is supposed to do?
<code>
Sub OL()
Dim objOL As Outlook.Application, msg As MailItem, p, i
Set objOL = CreateObject("Outlook.Application")
On Error Resume Next
For i = 1 To Range("h" & rows.Count).End(xlUp).Row
p = "C:\Users\RPlohocky\Desktop\Macro Projects\testing workbooks" & Cells(i, "h") & ".msg" ' template path
Set msg = objOL.CreateItemFromTemplate(p)
If Err.Number > 0 Then MsgBox "No such template", vbCritical, Cells(i, "h")
msg.Subject = "Driver Add Request Workflow# " & [d2] & " Fleet/Unit " & [e2] & " / " & [f2]
msg.Display
' msg.Send
Next
Set msg = Nothing
Set objOL = Nothing
End Sub
</code>
The code below works but only after the warning pops up. I get a critical warning pop up that says "No Such Template". Can anyone see why the warning pops up first then actually does what the macro is supposed to do?
<code>
Sub OL()
Dim objOL As Outlook.Application, msg As MailItem, p, i
Set objOL = CreateObject("Outlook.Application")
On Error Resume Next
For i = 1 To Range("h" & rows.Count).End(xlUp).Row
p = "C:\Users\RPlohocky\Desktop\Macro Projects\testing workbooks" & Cells(i, "h") & ".msg" ' template path
Set msg = objOL.CreateItemFromTemplate(p)
If Err.Number > 0 Then MsgBox "No such template", vbCritical, Cells(i, "h")
msg.Subject = "Driver Add Request Workflow# " & [d2] & " Fleet/Unit " & [e2] & " / " & [f2]
msg.Display
' msg.Send
Next
Set msg = Nothing
Set objOL = Nothing
End Sub
</code>