|
Posted by Sonnich on 03/16/07 13:52
Hi!
I looked around here for ole automation with excel, and put this
togther, which give this error:
Parse error: parse error, unexpected T_VARIABLE in C:\Inetpub\wwwroot
\JOTIntranet\Modules\changebrowser\excel2.php on line 14 (14= save
as).
I have tried a number of thigs, but cannot make this work... and not
figure out what it is
<?php
$excel = new COM("excel.application") or die("unable to instantiate
MSExcel");
//Ignore Alerts
$excel->DisplayAlerts = 0;
//Make Excel Visible
$excel->Visible = 1;
//Create a new workbook
$WB = $excel->Workbooks->Add;
$OutputFilename=dirname(__FILE__)."\\test_excel2.xls"
$excel->ActiveWorkbook->SaveAs("test_excel2.xls");
//Clean up and close, quit, release
$WB->Close();
//unset($WS);
unset($wB);
$excel->Workbooks->Close();
$excel->Quit();
unset($excel);
?>
[Back to original message]
|