Connecting Tech Pros Worldwide Forums | Help | Site Map

problem with excel

Sonnich
Guest
 
Posts: n/a
#1: Mar 16 '07
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.x ls"

$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);
?>


Rik
Guest
 
Posts: n/a
#2: Mar 16 '07

re: problem with excel


On Fri, 16 Mar 2007 14:52:49 +0100, Sonnich
<sonnich.jensen@elektrobit.comwrote:
Quote:
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).
Quote:
([13]) $OutputFilename=dirname(__FILE__)."\\test_excel2.x ls"
And the line with ';'........
--
Rik Wasmus
Sonnich
Guest
 
Posts: n/a
#3: Mar 16 '07

re: problem with excel


On Mar 16, 3:56 pm, Rik <luiheidsgoe...@hotmail.comwrote:
Quote:
On Fri, 16 Mar 2007 14:52:49 +0100, Sonnich
>
<sonnich.jen...@elektrobit.comwrote:
Quote:
Hi!
>
Quote:
I looked around here for ole automation with excel, and put this
togther, which give this error:
>
Quote:
Parse error: parse error, unexpected T_VARIABLE in C:\Inetpub\wwwroot
\JOTIntranet\Modules\changebrowser\excel2.php on line 14 (14= save
as).
([13]) $OutputFilename=dirname(__FILE__)."\\test_excel2.x ls"
>
And the line with ';'........
I am an idiot. It is Friday. Should go home a have a beer.

Thanks
Sonnich

Closed Thread