Puoi prendere spunto da quello che segue.
Il foglio excel "prova.xls" contiene due colonne con dei numeri.
codice:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<?
// lancio Excel rendendolo invisibile
$excel = new COM("Excel.Application");
$excel->Visible = 0;
//
$excel->SheetsInNewWorkbook=1;
$excel->Workbooks->Open('c:\temp\PROVA.XLS');;
$book=$excel->Workbooks(1);
$sheet=$book->Worksheets(1);
$sheet->Activate;
?>
<table summary=""><?
$continua = true;
$i = 0;
while ($continua) {
$i++;
$colonnaA = $sheet->Cells($i,1);
if ($colonnaA->Value != '') {
$colonnaB = $sheet->Cells($i,2);?>
<tr>
<td><? print $colonnaA->Value ?></td>
<td><? print $colonnaB->Value ?></td>
</tr><?
} else {
$continua = false;
}
} ?>
</table>
<?
$excel->Application->Quit;
// scollego Excel
unset($excel);
?>
</body>
</html>