How to fix a ActiveX cannot create a object error Outlook automation from Excel vba.

Antonio Garrido 0 Reputation points
2024-05-27T15:24:15.78+00:00

I have Office profesional plus 2021 64bit and Windows 10 64bit.

I receive this error: Error 429: ActiveX component cannot create object

I have a Excel Macro that prepare a customized email according to several data in a worksheet. This used to work, but suddenly stop working. This is the code

Sub Botón1_Haga_clic_en()

Dim OutApp As Outlook.Application

Set OutApp = CreateObject("Outlook.Application") 'Here is triggered the error

OutApp.Session.logon

Dim I As Long

Dim target_account As Outlook.Account

Set outMail = OutApp.CreateItem(0)

'Code for email preparation

I tried office reparation, I check the path in the "localserver32" variable of the register in  CLSID  in the outlook CLSID register {0006F03A-0000-0000-C000-000000000046}. (I tried adding and deleting the "/automation" flag at the end of the ...\Office16\OUTLOOK.EXE i.e "C:\Program Files\Microsoft Office\Root\Office16\OUTLOOK.EXE /automation" without quotes). Finallly I uninstall and reinstall office. Even I worked with microsodt tool to uninstall the complete Office "until the last file", but the problem persist.

What can I do for having my tool ok again?

Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,685 questions
Outlook Management
Outlook Management
Outlook: A family of Microsoft email and calendar products.Management: The act or process of organizing, handling, directing or controlling something.
5,039 questions
Excel Management
Excel Management
Excel: A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.Management: The act or process of organizing, handling, directing or controlling something.
1,685 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Antonio Garrido 0 Reputation points
    2024-05-30T01:27:21.0433333+00:00

    Finally nobody answer here. In Microsoft Community I was told that I have to write here. I contact a first level support by chat in microsoft and they cannot solve this issue. I did every thing recomended by Micrososft in his website and it did not work. I reinstall Office several times. I use a microsoft application to delete every single residual file from office before I installed it again. The problem still there.

    So finally I restore Windows (I have all my data but I lost every application installed) and it is working now!!! (but I have a lot of software to install and configure)

    Before I restore windows, I made an additional test. I create another macro, but this time in Word, This macro pretend to create a Excel workbook. It fail in the same process: createObject. So the problem was not related only to Outlook, but to Office and ActiveX in general.

    I think that it would be nice to have a procedure to make a better debug. An application (or procedure) that can say what is the problem: for example, this or that file is missing, the active X control was not registered, etc. I tried to find a windows log file that can report the error every time when happended (and I can make that happend runnig the macro). There is not such thing or I did not found it. I wrote this, only because could help someone.

    0 comments No comments