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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Power
Forum Newbie
Posts: 2
Joined: Fri May 17, 2002 6:15 am
Location: Hong Kong

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

Post 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
Post Reply