EasyXLS

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

Concept

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\v2.0.50727\regsvcs "<EasyXLS install path>\COM+ version\DLL\EasyXLS.dll"

EasyXLS.dll 64-bit

C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\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 2.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
.NET Excel Library
full .NET version to import, export or convert Excel files
.NET Excel Writer
.NET version to create and export Excel files
.NET Excel Reader
.NET version to read and import Excel files
.NET Express Excel Writer
limited .NET 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 - 2010
MS Excel 2013
MS Excel 2016
MS Excel 2019
XLSXXLSMXLSBXLS
XMLHTMLCSVTXT