Among other articles, look at the COM functions in PHP4 article:
http://www.phpbuilder.com/columns/
Alain
On Wed, Feb 28, 2001 at 11:35:15AM +0100, Daniel Tryba wrote:
> On Mon, Feb 05, 2001 at 03:05:24PM -0500, Conover, Ryan wrote:
> > I have been trying the following example from the PHP developer's cookbook
> > and it keeps giving me the following error.
> >
> > Parse error: parse error in c:\Inetpub\wwwroot/temp.php on line 5
> > <? //line 1
> > $excel_handle = new COM("excel.application"); //line2
> > $excel_handle->Visible = false; //line3
> > $worksheet = $excel_handle->workbooks->add(); //line4
> > $worksheet->Cells(1,1)->value = "Name"; //line5
> > $worksheet->SaveAs("temp.xls"); //line6
> > $excel_handle->quit(); //line7
> > //line8
> > ?> //line9
> >
> > Anyone that has Com and PHP experience help please
>
> I didn't test it in PHP (only in wscript.exe), but it seems the example
> is wrong. It should be (line 4 -> 4a, 4b):
>
> excel_handle = new COM("Excel.Application"); //line2
> excel_handle.Visible = true; //line3
> workbook = excel_handle.Workbooks.Add(); //4a
> worksheet=workbook.WorkSheets.Add(); //4b
> worksheet.Cells(1,1).Value = "Name"; //line5
> worksheet.SaveAs("temp.xls"); //line6
> excel_handle.quit(); //line7
>
> This seems to work.
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]