Outlook mail errors out Server Execution Failed

ChuckDrago

Active Member
Joined
Sep 7, 2007
Messages
470
Office Version
  1. 2010
Platform
  1. 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"))
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
 
Buenos dias Dante,
Your proposed solution threw errors on the Dim statements OutApp and OutMail aas well as on the statement Set OutApp. The error message reads "User-defined type not defined". Please advise?
Thanks a bunch!
Chuck
Buenos días!

you must do the steps of the note.
 
Upvote 0

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Dante,

Please see the References the application has checked (they were those since inception).
Capture.JPG


Falta algo mas?
Chuck
 
Upvote 0
This reference is missing:

Microsoft Outlook xx.x Object Library

Search and check
 
Upvote 0
Aaartgh#@$%#!!! I always thought that MS Office would encompass ALL apps under MS, including Outlook!
Found it, checked it and sent test forms to field people with problems. Will keep you posted.
Thank you, Dante . Muy agradecido
 
Upvote 0

Forum statistics

Threads
1,215,020
Messages
6,122,709
Members
449,093
Latest member
Mnur

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top