Can't send email generated from other office program without unspecific error message "The operation failed".

Posted on 2014-10-22
Last Modified: 2014-10-27
I have an access database and an excel spreadsheet that are set up to generate emails in outlook.  These have always worked without any issue, but since the end of last week, although the email window is created as normal, when the user clicks on the 'Send' button, Outlook generates and error - "The operation failed."

However, if I open Outlook and then create a new email message and copy and paste the information to this new email window, it sends without error.

I am using Office 2010 in a Terminal Server environment, and Outlook is connected to an Exchange 365 server.  I have tried restarting the server and deselected and reselected the appropriate library files within access and this has not fixed the problem.  I'm guessing there may have been an update that is causing me problems.

Please help!
Question by:thechrisrobertstoo
  • 4
  • 4
LVL 84

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 40396555
First thing to do is make sure Office and Windows are fully updated, including all Service Packs and relevant Hotfixes.

Might want to check the Event Viewer on the machine immediately after this fails, see if you find any MAPI or other relevant errors.

Does the email have an attachment? If so, try using Access to send the email only, without the attachment, and see if it fails.

Otherwise, I'd try using your code to create the simplest email you could - just a SendTo, Subject and Body - and see if that goes through. If it does, start adding other attributes your code uses, and see where/when it fails.

Author Comment

ID: 40396625
Ok, this is interesting, because having written a very simple subroutine to just generate an email for me to send, it works correctly, but the crux of the mail generating code is the same as what I'm using in my Access form.  I don't have anything more complicated than subject and body text, I don't even complete the 'To' field as this is not useful for this process.

Still driving me nuts!  Unfortunately I have an urgent need to work on something else, so I will have to leave this until tomorrow.
LVL 84
ID: 40396670
You may have some corruption in the database file. Try creating a new, blank database and importing everything to that database, and see if the trouble goes away.

Author Comment

ID: 40396674
I might agree, except I experience the exact same issue when generating emails from an Excel spreadsheet.
Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

LVL 84
ID: 40396747
Does this happen on multiple RDS desktops, or only one?

If it's only one, you might have a corrupt user profile. If so, then you generally have to recreate that profile.

If it happens on multiple RDS desktops, then my guess would be inconsistency in the install of Outlook on the RDS system. You'll very likely have a difficult time convincing the IT people of that, of course.

deselected and reselected the appropriate library files within access
Are you using early or late binding? If you're using Early binding (where you write code like Dim otl As Outlook.Application), you might try switching over to Late binding.

Also - are all users of the database running the same version of Access, and the same version of Outlook? Generally this is the way things work, but I've seen some situations where RDS systems were configured differently.

Accepted Solution

thechrisrobertstoo earned 0 total points
ID: 40396783
Yes, it happens for all users, and they all use the same version of Access.  I'm also using early binding.

Because I'm like a dog with a bone, I haven't been able to leave this alone and have found that if I call a separate subroutine to handle the email window AND if I remove the code that determines the BodyFormat of the email (normally set to olFormatPlain), I've managed to get it working.

It occurs to me that these failures only started after a routine re-boot of the TS server, though I can't for the life of me think why any security updates would object to email BodyFormats.

Now all I need to do is test it a bit more and then roll out these changes to my Excel spreadsheet as well.

I appreciate all your helpful suggestions, many thanks.
LVL 84
ID: 40396896
That is very odd ... rebooting the machine shouldn't have any impact on that, it would seem - but then who knows.

Still think it would be prudent to perform maintenance on your database. Make a backup, then do this:

1. Compact the database
2. Compile the database - from the VBA Editor, click Debug - Compile. Fix any errors, and continue doing this until the menu item is disabled.
3. Compact again

Might also want to Decompile the app. To do that, create a shortcut with this as the Target:

"full path to msaccess.exe" "full path to your db" /decompile

Run this shortcut, then do the 3 steps above again.

Finally, it's sometimes a good idea to create a new, blank database and import everything to that db. This can clear up any container corruption you might have.

But be sure to make a backup before you start anything ...

Author Closing Comment

ID: 40405951
The solution turned out to be trial and error, though I never addressed the cause of the issue.  Scott was very helpful in encouraging a step-by-step approach to solving this so he can have all the points.

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Are you unable to connect or configure Hotmail email account in Microsoft Outlook 2010, 2007? Or emails are not downloading to Outlook? Lets’ see the problem and resolve Outlook Connector error syncing folder hierarchy (0x8004102A).
MS Outlook is a world-class email client application that is mainly used for e-communication globally.  In this article, we will discuss the basic idea about MS Outlook, its advanced features, and types of MS Outlook File formats.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now