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 registeredIf 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-bitC:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\regsvcs "<EasyXLS install path>\COM+ version\DLL\EasyXLS.dll" EasyXLS.dll 64-bitC:\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-bitIf 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-bitIf 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' |