"Class Not Registered" Run-time Error '-2147221164 (80040154)'

We have macro-enabled word documents that we use and recently started receiving this error message. I guess some machines were pushed M365 64 bit instead of 32.

Compile Error:
The code in this project must be updated for use on 64-bit systems. Please review and update Declare statements and then mark them with the PtrSafe attribute.


I've updated the following code:

Declare PtrSafe Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long


Dim ttid As Integer

Dim endt As Single, startt As Single


However, now I am receiving the following error...

Run-time Error '-2147221164 (80040154)'

Class not registered


I was thinking that this might have to do with the references, but am not positive. Any help would be greatly appreciated.

Hi A. User

Thank you for posting in this community, and I apologize for the inconvenience caused.

According to my research, I'm sorry, but I haven't found out the cause of "Run-time Error'-2147221164 (80040154)", which may be caused by many factors.

Therefore, for your situation, you can try the suggestions on the following website and get help by browsing the website. For details, please click here

Unfortunately, I am not an expert in code. If you need further help, you can try to visit the Tech documentation to get answers from the experts inside.

In addition, I understand the inconvenience this situation brings to you. In this case, it is recommended to send feedback in the Microsoft Q&A community.

Thanks for understanding and stay safe!

Chandy | Microsoft Community Support Specialist

-----------------------

* Beware of scammers posting fake support numbers here.

* Kindly Mark and Vote this answer if it helps as it will be beneficial to more community members reading here.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

If you send me a copy of the document, referencing this thread in the covering email message, I will investigate the issue.

Hope this helps,
Doug Robbins - MVP Office Apps & Services (Word)
dougrobbinsmvp@gmail.com
It's time to replace ‘Diversity, Equity & Inclusion’ with ‘Excellence, Opportunity & Civility’ - V Ramaswamy

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Thank you, Chandy. I will review the links you provided.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Thank you, Doug. I cannot share the entire document but could probably share more of the code and give you additional details. Should I send this information to your Gmail?

1 person found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

I am experiencing the same, I just purchase a new desk top, and upgraded to windows 11, then went to Microsoft 365 and installed office...

I copied the access table required to the correct location and copied the excel file that interacts with that database... attempting to execute its function I get the class not registered error...

The bolden code line below is where the error occurs

Dim db As Database

Dim rs As DAO.Recordset

Set db = OpenDatabase("C:\Lottery\dbFloridaPicks.mdb")

Set rs = db.OpenRecordset("CashMoney", dbOpenTable)

thanks,

Bill

3 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

I got this error when using a 64 bit version of Microsoft Office. When I used the 32 bit version of Microsoft Office it worked.

VFP Programmer

8 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated May 20, 2024 Views 13,258 Applies to: