ChuckDrago
Active Member
- Joined
- Sep 7, 2007
- Messages
- 470
- Office Version
- 2010
- Platform
- Windows
One of our field guys is unable to send it automated expenses via a macro controlled Excel Worksheet. His colleagues do without a hitch. IT has not been able to diagnose the problem.
The person is running a W10 laptop, using MS Office 2010. The code is shown below (the error is caused by the line Set OutApp = CreateObject("Outlook.Application.14"))
Any suggestions will be much appreciated, as usual.
Thanks,
Chuck
The person is running a W10 laptop, using MS Office 2010. The code is shown below (the error is caused by the line Set OutApp = CreateObject("Outlook.Application.14"))
VBA Code:
Dim OutApp As Object
Application.DisplayAlerts = False
Dim OutMail As Object
Dim FName As String
FName = ActiveWorkbook.Name
ActiveWorkbook.SaveAs ("C:\temp\" & FName)
Set OutApp = CreateObject("Outlook.Application.14")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = MailTo & ";"
.CC = CcTo
.BCC = ""
.Subject = Subj
.Body = OutMsg & Chr(13) & Chr(13) & Sender
.Attachments.Add ActiveWorkbook.FullName
.Send
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
Application.DisplayAlerts = True
End Sub
Any suggestions will be much appreciated, as usual.
Thanks,
Chuck