0
votes

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?

2
Can you reference the Outlook and Redemption type libraries instead of late-binding? - Mathieu Guindon
Is it just this box that is running Access 64 bit? You might have to distribute and register the 64 bit version of Redemption - dbmitch

2 Answers

1
votes

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

0
votes

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.