Bonjour à tous,
Après de veine recherche sur mon erreur concernant la création d'un objet COM (dans mon cas COM("excel.application). Je me tourne vers vos lumières ^^.
Voici mon code, puis l'eereur qu'il me retourne
Code PHP :
<?php
$FILENAME="chemin_de_mon_fichier\monfichier.xls"; //nom du fichier à ouvrir
//ouverture du fichier
$excel=new COM("Excel.application")or die("Impossible d'instancier l'application Exel");
$excel->Workbooks->Open($FILENAME);
$book=$excel->Workbooks(1);
$sheet=$book->Worksheets(1);
/*$cell=$sheet->Range('E33'); //selection de la cellule
$cell->value='0'; //remplissage
//sauvegarde et fermeture du fichier */
$book->Save();
unset($sheet);
unset($book);
$excel->Workbooks->Close();
$excel->Quit();
unset($excel);
?>
Et voici l'eereur retourné:
Code :
Fatal error: Uncaught exception 'com_exception' with message 'Failed to create COM object `Excel.application': Syntaxe incorrecte ' in D:\OCS Inventory NG\xampp\htdocs\monsite\envoiexcel.php:7 Stack trace: #0 D:\OCS Inventory NG\xampp\htdocs\monsite\envoiexcel.php(7): com->com('Excel.applicati...') #1 {main} thrown in D:\OCS Inventory NG\xampp\htdocs\monsite\envoiexcel.php on line 7
la ligne 7 correspond à:
$excel=new COM("Excel.application")or die("Impossible d'instancier l'application Exel");
J'utilise XAMPP 1.5.5, et excel 2003.
Si vous avez une proposition pour résoudre se problème, je suis preneur ^^.