Re: Re: Revised [PHP] COM and PHP

From: Date: Wed, 28 Feb 2001 17:47:21 +0000
Subject: Re: Re: Revised [PHP] COM and PHP
References: 1 2  Groups: php.general php.windows 
Request: Send a blank email to php-general+get-42044@lists.php.net to get a copy of this message
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: php-windows-unsubscribe@lists.php.net > For additional commands, e-mail: php-windows-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#42044) next »