'Outlook Redemption error in MS Access: ActiveX component can't create object

Code:

    Dim Application As Object, namespace As Object
    Set Application = CreateObject("Outlook.Application")
    Set namespace = Application.GetNamespace("MAPI")
    namespace.Logon

    Set safeItem = CreateObject("Redemption.SafeMailItem") ' Error here!

Normally this code works fine on most of my boxes -- but in this case I am running this in MS Access 2010 (64-bit) if it matters.

But the line where safeItem is assigned, I get the error that "ActiveX component cannot create object." What does this even mean? Why can't I create the object? The reference to Redemption seems to be okay / doesn't show as MISSING or anything.

I Google this error and there seems to be numerous possible causes since the error is so vague. Is there a well-known reason for this particular instance?



Solution 1:[1]

Make sure the bitness of Outlook (and MAPI system) matches the bitness of Access - see http://www.dimastr.com/redemption/faq.htm#ErrorCreatingRedemptionObject for more details.

Solution 2:[2]

The creatobject call can throw a variety including Automation Error (-2146232576) amongst others. It has been my experience that when a piece of software runs fine on one PC and not another, and the error is caused by a creatobject call then the culprit is usually a missing or incorrectly registered DLL.

The quick way to solve it (particularly in Windows 10) that I have found is to open Windows Features and if.NetFramework 3.5 is not selected, then select it and click OK. If .Netframework 3.5 is selected, then unselect it and click OK. reboot, return to Windows Features, and reselect .NetFramework 3.5 and click OK. This will cause Windows to install and register all the required DLLs and other components.

You should be right after that.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ryan M
Solution 2 Greg Sevior