EasyXLS

Why do I get "Failed to create COM object EasyXLS.ExcelDocument: Invalid syntax" error in PHP?

Concept

The following error might occur at runtime when using EasyXLS Excel library for PHP:

Fatal error: Uncaught com_exception: Failed to create COM object 'EasyXLS.ExcelDocument': Invalid syntax.

at line:

$workbook = new COM("EasyXLS.ExcelDocument");

Possible reason: 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 lines 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.


Contact us for any other reasons

If none of the above, contact us at support@easyxls.com with details about your application configuration and the full error message.


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

File formats:

MS Excel 97 - 2003
MS Excel 2007 - 2010
MS Excel 2013
MS Excel 2016
MS Excel 2019
XLSXXLSMXLSBXLS
XMLHTMLCSVTXT