Excel VBA Office 2019 Class not Registered Run time Error 2147721164 (80040154)

Anonymous
2021-07-19T23:50:57+00:00

Hi

I have a macro that used to run fine and now gives me the error message as shown below

I need to open up outlook and then loop through a database to send a customized emails to each person

I created a brand new spreadsheet so there is nothing in it except the macro

it blows up and gives me the error message on the line

Set Testmail_object = CreateObject("Outlook.Application")

I have googled this and no one seems to address the problem

Thank you!

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

11 answers

Sort by: Most helpful
  1. Anonymous
    2021-07-20T01:33:03+00:00

    Hi Quantinal, hope you're doing well. I’m Ian, an Independent Advisor and Microsoft user like you.

    I'm sorry to hear about this issue.

    Based on experience, this is due to bad dll / com file.

    You can do Office repair in this case.

    1. Open Control Panel - Programs and Features
    2. Select Microsoft Office in the application list
    3. Right click and click 'Change'
    4. Click 'Repair' then select Online Repair

    You can the link below for more details

    https://support.microsoft.com/topic/repair-an-o...

    If the issue is not related to Microsoft, you can repair of Windows problem.

    1. Press the Start key and type the word CMD, right click on the command prompt and select Run as administrator,
    2. Enter the following commands one by one followed by the Enter key:
      • DISM.exe /Online /Cleanup-image /Scanhealth
      • DISM.exe /Online /Cleanup-image /Restorehealth
      • DISM.exe /online /cleanup-image /startcomponentcleanup
      • sfc /scannow

    This is a user-to-user support forum and I am a fellow user.

    I hope this helps, but please let me know if you need anything else.

    3 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2021-07-20T02:43:01+00:00
    1. The repair MS office failed and totally deleted Office from my computer
    2. When I was running "DISM.exe /Online /Cleanup-image /Scanhealth" it froze on 63%

    ![](https://learn-attachment.microsoft.com/api/attachments/34d8c5d8-614d-4220-b4b1-260efb8c5e34?platform=QnA

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2021-07-20T02:53:20+00:00

    Microsoft should just do repair and not uninstall.

    Hopefully the uninstall button was not chosen in this process.

    DISM really takes some time since it scan and fix some issues.

    0 comments No comments
  4. Anonymous
    2021-07-20T04:56:11+00:00

    I did not hit the "uninstall button"

    I

    • re-installed Excel
    • ran all of the DISM's and SFC
    • ran Dell support assist
    • rebooted

    and Still same error!

    FYI - I am running Outlook 2007, and the error occurs in both Excel 2007 and Excel 2019 so probably not related to MS Office Issues

    0 comments No comments
  5. Anonymous
    2021-07-20T05:55:36+00:00

    Lets see if another user has anymore ideas and have the experience the issue especially on the 2007 version of the applications

    0 comments No comments