EasyXLS

Why do I get "Class not registered" error in C++

The following error might occur at runtime when using EasyXLS Excel library in C++:

Class not registered   or

Object is not available!

at line:
CoCreateInstance(__uuidof(EasyXLS::ExcelDocument),
NULL,
CLSCTX_ALL,
__uuidof(EasyXLS::IExcelDocument),
(void**) &workbook);

Possible reason #1: EasyXLS.dll is not registered

If you did not have administrative rights when you installed EasyXLS, it is possible that the COM+ registration was not accomplished during installation.

To check this situation, go to Control Panel -> Administrative Tools -> Component Services.
See if EasyXLS is present in Console Root/Component Services/Computers/My Computer/COM + Applications.

EasyXLS component in Component Services

If it is not present, EasyXLS must be registered using specific commands for EasyXLS 32-bit and EasyXLS 64-bit. Run as administrator one of the following command line from Command Prompt:

EasyXLS.dll 32-bit

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\regsvcs "<EasyXLS install path>\COM+ version\DLL\EasyXLS.dll"

EasyXLS.dll 64-bit

C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\regsvcs "<EasyXLS install path>\COM+ version\DLL\EasyXLS.dll"

Regsvcs.exe can be stored in a different location if you have a different version of Microsoft .NET Framework installed on your computer. The above path is the default location for version 4.0.

Possible reason #2: Visual Studio project and EasyXLS.dll for 64-bit

If the EasyXLS version for 64-bit is used, check the project properties and make sure that on the Configuration Properties node, Linker, Advanced, the Target Machine is set to x64.

Visual Studio, C++ project properties on Linker, Advanced settings

After setting the Target Machine to x64, when building the project the following error might occur:
fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'


Possible reason #3: Visual Studio project and EasyXLS.dll for 32-bit

If the EasyXLS version for 32-bit is used on a Windows 64-bit operating system, check the project properties and make sure that on the Configuration Properties node, Linker, Advanced, the Target Machine is set to x86.

Visual Studio, C++ project properties on Linker, Advanced settings

After setting the Target Machine to x86, when building the project the following error might occur:
fatal error LNK1112: module machine type 'X64' conflicts with target machine type 'x32'


Available for: Professional, Excel Writer, Excel Reader, Express Excel Writer
Go to top

EasyXLS Excel libraries:

.NET
Excel Library for C++
full COM+ version to import, export or convert Excel files
Excel Writer for C++
COM+ version to create and export Excel files
Excel Reader for C++
COM+ version to read and import Excel files
Express Excel Writer for C++
limited COM+ version to create and export Excel files in predefined formats
Download EasyXLS™ Excel Library for .NET and Java

File formats:

MS Excel 97 - 2003
MS Excel 2007 - 2019
MS Excel 2021
Office 365
XLSXXLSMXLSBXLS
XMLHTMLCSVTXT