Link to home
Start Free TrialLog in
Avatar of slimguy
slimguy

asked on

Access automation call to Outlook failing

An Access database uses Office Automation to create Outlook emails (using late binding). A client has installed Office 2007 (from disk) onto an Asus Windows 8 machine, and is getting the attached error message. I assume the problem is connected with incompatible dll's, but which ones?

Could running in Windows 8 be a problem? Could automatic updates and/or service packs have created incompatible dll's? Are there any diagnostics I can run?
Capture2.PNG
ASKER CERTIFIED SOLUTION
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of slimguy
slimguy

ASKER

The client has already done an Office Repair - no change.
Can you show the code you're using?

Also - can you verify that you don't have reference issues? A faulty reference can cause lots of troubles - and while you're using Late Binding for this operation, bad references in other libraries can cause Access to choke.
Avatar of slimguy

ASKER

Dim objOutlook As Object
    Dim objEmailMessage As Object
    Set objOutlook = CreateObject("Outlook.Application")
    Set objEmailMessage = objOutlook.CreateItem(0)
   
    l_body = "text here"
   
    objEmailMessage.Recipients.Add "sendsms@messaging.intellisoftware.co.uk"
    objEmailMessage.Subject = smsmessage
    'objEmailMessage.BodyFormat = 1 'Plain text
    objEmailMessage.Body = l_body
   
    objEmailMessage.Display
   
    Set objEmailMessage = Nothing
    Set objOutlook = Nothing

The only references are to VB, Access Object Library, DAO 3.6 Object Library, and one other special one. The db usually crashes immediately if any references are missing.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What is smsmessage?  If it is a variable, it is not set in your code.
Avatar of slimguy

ASKER

smsmessage is string variable set earler. The code is only a partial extract.
Have you added the database location as a Trusted Location?

Also - where is the database installed on the machine? If you're installing to the Program Files directory, you might be running into permissions issues of some sort. On machines with UAC, you must be sure to install the application into an appropriate directory (and that's not Program Files, since an Access "application" is not an executable). If you think this might be an issue, try moving it to a folder in My Documents, or try creating a directory directly off the root drive (like C:\MyApp)
Avatar of slimguy

ASKER

It's not in Program Files, it is in a directory off the C drive.
Okay ... but have you added that location as a Trusted Location? 2007 introduced the concept of "Trusted Locations".

See this article for various ways to address that:

https://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/A_10805-Overcome-the-Trust-Center-Nuisance.html
Avatar of slimguy

ASKER

I suspect the problem is probably the result of a faulty Office install, or subsequent updates. Repair didn't work. I have decided to avoid the problem by using CDO instead of Outlook (yes, I now it's a cop-out!).