Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Retrieving the COM class factory for component with CLSID {6C9E80E3-B780-4361-A693-5E5C6BDC83A9} failed due to the following error: 80040154

I am getting this error:
Retrieving the COM class factory for component with CLSID {6C9E80E3-B780-4361-A693-5E5C6BDC83A9} failed due to the following error: 80040154.

Dim smgrGlobal As QBSessionManager
smgrGlobal = New QBSessionManagerClass()

The 2nd line is the one that errors.
I get this error only with QB2013 and QBFC12. This does not happen with any previous versions.
I as far as I can find, this error is due to an application not being compiled for x86 (if "Any CPU" was used instead.) However I have set my application to compile for x86 NOT "Any CPU" and I am still receiving this error.

like image 489
Casey Barsness Avatar asked Feb 22 '13 23:02

Casey Barsness


1 Answers

COM error 0x80040154 literally means "class not registered". The "class" being referred to is the COM class for the component that you're trying to instantiate. Here are the reasons you might get this error:

  1. As you noted, if you build your app with "x64" or "Any CPU" instead of "x86" you will see this problem. That's because 32 bit processes use a different registry hive than 64 bit processes, and the registry is where information about COM class registration is kept.
  2. You have not properly installed QBFC on the current local machine. Whatever the version of QBFC you used to develop your application, you must install that same version of QBFC on every computer on which your application runs. If you don't, you may get lucky because someone else installed the correct version, but eventually you will see this problem. Let me emphasize: QBFC is not installed with QuickBooks by default.
  3. (less likely but possible) Somehow the COM registration information for QBFC has become corrupted. This problem can be solved by re-installing the correct version of QBFC.
like image 104
Paul Keister Avatar answered Sep 20 '22 04:09

Paul Keister