Hi everyone.
I have a mystery to solve, I wrote a VBA sub to send an Email (From Access 2010).
The macro works fine in 9 computers but it fails to do his work in just 2 computers, it is not a big deal but I'll be wonder if I can fix this issue, here is the code, any help will be REALLY appreciated.
Thanks in advance and best regards.
I have a mystery to solve, I wrote a VBA sub to send an Email (From Access 2010).
The macro works fine in 9 computers but it fails to do his work in just 2 computers, it is not a big deal but I'll be wonder if I can fix this issue, here is the code, any help will be REALLY appreciated.
Thanks in advance and best regards.
Code:
Sub SendEmail_Pull_and_Send_Fields_Alt1()
Dim oOutlook As Object
Dim oEmailItem As Object
ActDte = Date
'Prevent 429 error, if Outlook not open
On Error Resume Next
Err.Clear
Set oOutlook = GetObject(, "Outlook.Application")
If Err.Number <> 0 Then
Set oOutlook = Outlook.Application
End If
Set oEmailItem = oOutlook.createitem(olmailitem)
With oEmailItem
.To = ""
.cc = ""
.subject = "Pull and send fields updated in TRICareTST4 database on " & ActDte
.body = "Pull and send fields for (Repace with your data) has been updated." & vbNewLine & "Please continue with the assigned flow."
.display
End With
Set oEmailItem = Nothing
Set oOutlook = Nothing
End Sub