Using COM to generate excel file - php version of vb Sheets("Report First page").Copy After:=Sheets(1)

From: Date: Thu, 27 Jun 2002 01:30:14 +0000
Subject: Using COM to generate excel file - php version of vb Sheets("Report First page").Copy After:=Sheets(1)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-104082@lists.php.net to get a copy of this message
Win2Kpro, PHP4.2.1, Apache 1.3.26dev I would like to make a copy of a sheet in an existing excel spreadsheet from within PHP using COM. I can open an existing .xls file and rename a sheet using; ========8<================= $excel = new COM("Excel.Application") or die("Excel could not be started"); $excel->DisplayAlerts = 0;// turn off alerts $workbook = "c:\\tmp\\tst1.xls"; $wkb = $excel->application->Workbooks->Open($workbook) or Die ("Did not open"); $sheet1 = $wkb->Worksheets(1); //Select the sheet $sheet1->activate; //Activate it $sheet1->name="Report First page"; ========8<================= To try and work out how to copy a sheet I created a macro in excel; Sheets("Report First page").Select Sheets("Report First page").Copy After:=Sheets(1) Sheets("Report First page (2)").Select Sheets("Report First page (2)").Name = "new Sheet" My problem is that I can't work out the php version of Sheets("Report First page").Copy After:=Sheets(1) ie there is a space between Copy and After and how do I get the := operator? Any suggestion much appreciated. (I have looked through the online docs, mailing list, ms and googled but havn't found a solution) Regards Andrew Braund

« previous php.general (#104082) next »