Page 1 of 1

Open an Excel file (COM object) in client side?

Posted: Fri May 17, 2002 6:15 am
by Power
I read from some books that php supports COM object. So I think it should be possible that to move some data from the browser to an Excel worksheet or just simply open a client's side's Excel file.
But I tried the below code, it will only open an Excel file on the server side when I access the php file from a client but not on the client side. Anyone knows how to do it? Or can we do it?

<?php
$exapp = new COM("excel.application") or Die ("Did not connect");
$exapp->Visible = true;
$workbook = $exapp->workbooks->Add();
$worksheet = $workbook->Worksheets(1);
$worksheet->activate;
$cell = $worksheet->Cells(1,1);
$cell->value = "Name";
$cell = $worksheet->Cells(1,2);
$cell->value = "Salary";
$cell = $worksheet->Cells(1,3);
$cell->value = "Time of Employment";
$worksheet->SaveAs("emp_reports-salary.xls");
$exapp->quit();
?>

Regards
Power