Hi guys

I managed to get this far with my Excel spreadsheet:

// Set the workbook to use and it's sheet
$workbook=$_GLOBALS["templatedir"]."\ElectricityTransactions.XLT";
$sheet="Sheet1";

//Instantiate the spreadsheet component.
$ex = new COM("Excel.sheet") or Die ("Did not connect");

//Open the workbook that we want to use.
$wkb = $ex->application->Workbooks->Open($workbook) or Die ("Did not open");

//Create a copy of the workbook, so the original workbook will be preserved.
$ex->Application->ActiveWorkbook->SaveAs($_GLOBALS["reportdir"]."\rpt_electrans_".trim($Outlet_session).".xls");
//$ex->Application->Visible = 1; #Uncomment to make Excel visible.

//Read and write to a cells in the sheet
$sheets = $wkb->Worksheets($sheet); //Select the sheet
$sheets->activate; //Activate it

$cell = $sheets->Cells(1,2) ; //Select the cell (Row Column number)
$cell->activate; //Activate the cell
$cell->value = "ELECTRICITY TRANSACTIONS Outlet ".trim($Outlet_session); //Change it


But now how would I insert a range i.e., simulate in Excel the following:

Select range B8:H8. Right click and select insert.

Any ideas?

Cheers
Louis

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to