I have a macro that generates an email at the click of a button. It is on a workbook that is distributed to others who do the same thing I do but for differing regions. Obviously the macro works for me. But one of the others says it simply does nothing for her. I had her send me her up to date workbook and opened it on my computer and the macro ran as advertised. One of the others also runs the macro fine on his machine.
I'm thinking the issue is somewhere in her Outlook or Windows Setting and isn't an Excel issue. Here is the code, if anyone sees anything wrong I'd appreciate the chance to learn from it. Thanks for looking.
Sub RaEmail()
On Error GoTo ErrHandler
' SET Outlook APPLICATION OBJECT.
Dim objOutlook As Object
Set objOutlook = CreateObject("Outlook.Application")
' CREATE EMAIL OBJECT.
Dim objEmail As Object
Set objEmail = objOutlook.CreateItem(olMailItem)
With objEmail
.To = Sheets("Remote SM").Range("U1").Value
.CC = Sheets("Remote SM").Range("U2").Value & ";" & Sheets("Remote SM").Range("U3").Value & ";" & Sheets("Remote SM").Range("U4").Value
'.BCC = "REGIONAL MANAGERS;"
.Subject = UCase(Sheets("Remote SM").Range("A6").Value) & ": " & "OLD RA WARNING"
.Body = Sheets("Remote SM").Range("A6").Value & " " & "has old or past due RA's as shown below." & vbNewLine & "Beginning in August we will not pull for anyone whose RA's are past due." & vbNewLine & "Please have the tech turn in the old or past due RA immediately so it can be picked up on the next truck headed back to the warehouse."
'& vbNewLine & ThisWorkbook.Sheets("Remote SM").Range("RETURNS")
.Display ' Display the message in Outlook.
End With
' CLEAR.
Set objEmail = Nothing: Set objOutlook = Nothing
ErrHandler:
'
End Sub
Bookmarks