leer archivos excel
Publicado por sebastian (2 intervenciones) el 10/04/2006 19:05:09
hola queria saber si alguien sabe como leer archivos xls usando php sin pasarlo a cvs yo use objetos com pero me da el siguiente error:
Warning: (null)(): Unable to obtain IDispatch interface for CLSID {00024500-0000-0000-C000-000000000046}: Acceso denegado. in c:\inetpub\wwwroot\arcangel\excel.php on line 6
unable to start MSExcel
no se que sera el codigo que uso es este:
<?php
$strSheetName = 'Sheet1' ;
$strCellName = 'A1';
$objXLApp = new COM( "Excel.application" ) or die( "unable to start
MSExcel" );
$objXLApp->Workbooks->Open( "c:\\temp\\test.xls" );
$objXLSheet = $objXLApp->ActiveWorkBook->WorkSheets( $strSheetName );
$objXLCell = $objXLSheet->Range( $strCellName );
print "Cell $strCellName in $strSheetName: \"" . $objXLCell->Value() .
"\"\n";
// must do all of these to release resources correctly...
unset( $objXLCell );
unset( $objXLSheet );
$objXLApp->ActiveWorkBook->Close();
$objXLApp->Quit();
unset( $objXLApp );
?>
si alguien sabe como hacerlo por favor avise. Gracias.
Warning: (null)(): Unable to obtain IDispatch interface for CLSID {00024500-0000-0000-C000-000000000046}: Acceso denegado. in c:\inetpub\wwwroot\arcangel\excel.php on line 6
unable to start MSExcel
no se que sera el codigo que uso es este:
<?php
$strSheetName = 'Sheet1' ;
$strCellName = 'A1';
$objXLApp = new COM( "Excel.application" ) or die( "unable to start
MSExcel" );
$objXLApp->Workbooks->Open( "c:\\temp\\test.xls" );
$objXLSheet = $objXLApp->ActiveWorkBook->WorkSheets( $strSheetName );
$objXLCell = $objXLSheet->Range( $strCellName );
print "Cell $strCellName in $strSheetName: \"" . $objXLCell->Value() .
"\"\n";
// must do all of these to release resources correctly...
unset( $objXLCell );
unset( $objXLSheet );
$objXLApp->ActiveWorkBook->Close();
$objXLApp->Quit();
unset( $objXLApp );
?>
si alguien sabe como hacerlo por favor avise. Gracias.
Valora esta pregunta


0