Hi guys,
Im trying to access excel file using COM object but still I have been unable to do it. I have tried many ways. I have PHP 5.0.5 which runs in Apache and the operating system is windows XP.
I have simply tried to create the object as below,
<?php
$excelApp = new COM("Excel.Application") or die("Cannot create an Excel object");
?>
but this gave me an error saying,
Fatal error: Uncaught exception 'com_exception' with message 'Failed to create COM object `Excel.Application': Server execution failed ' in C:\Program Files\xampp\htdocs\websites\htmlFeed\streaming\com_parser.php:5 Stack trace: #0 C:\Program Files\xampp\htdocs\websites\htmlFeed\streaming\com_parser.php(5): com->com('Excel.Applicati...') #1 {main} thrown in C:\Program Files\xampp\htdocs\websites\htmlFeed\streaming\com_parser.php on line 5
I have tried the same code with another machine and it works fine. the only difference that both machine has is, machine one has installed PHP separatly but my machine I have used xampp (automatic installer that comes with PHP / mysql / Apache ..etc)
I have done some research and it says this can be due to the permission error. so i changed the permission by going,
Control Panel->Administrative Tools->Component Services->Component Services ->Computers->My Computer->DCOM Config->Microsoft excel
But still im getting the same error.
Does anyone knows the reason for this???
Thanks In advance,
Regards,
Niroshan