Hi,
seit Stunden versuche ich einen Fehler zu finden. Das folgende Snippet funktioniert under XP, Office XP mit PHP5.
Unter Vista ultimate, Office 2007 und php gibt es folgenden Fehlerhinweis:
Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> Microsoft Office Excel<br/><b>Description:</b> Die SaveAs-Eigenschaft des Workbook-Objektes kann nicht zugeordnet werden.'
$exapp = new COM("Excel.Application") or Die ("Did not connect");
$wkb = $exapp->Workbooks->Add();
$exapp->Application->Visible = 1;
$sheet=$wkb->Worksheets(1);
$sheet->activate;
$sheet->Name="Control";
$strPath = "C:/xampp/htdocs/Control.xls";
if (file_exists($strPath)) {unlink($strPath);}
$wkb->SaveAs($strPath);
$wkb->Close(false);
unset($sheet);
Bin für jede Hilfe dankbar.
Tx in advance.
seit Stunden versuche ich einen Fehler zu finden. Das folgende Snippet funktioniert under XP, Office XP mit PHP5.
Unter Vista ultimate, Office 2007 und php gibt es folgenden Fehlerhinweis:
Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> Microsoft Office Excel<br/><b>Description:</b> Die SaveAs-Eigenschaft des Workbook-Objektes kann nicht zugeordnet werden.'
$exapp = new COM("Excel.Application") or Die ("Did not connect");
$wkb = $exapp->Workbooks->Add();
$exapp->Application->Visible = 1;
$sheet=$wkb->Worksheets(1);
$sheet->activate;
$sheet->Name="Control";
$strPath = "C:/xampp/htdocs/Control.xls";
if (file_exists($strPath)) {unlink($strPath);}
$wkb->SaveAs($strPath);
$wkb->Close(false);
unset($sheet);
Bin für jede Hilfe dankbar.
Tx in advance.
Comment