No te preocupes no me he ofendido. Pero mientras tanto puedes hacerlo de esta forma, que no es la que te sugiero sino que busques sobre la clase que te indique. Con el PHPExcel siempre trata los ejemplos que te dan y luego modifícalo a tus necesidades. Pero aqui tienes un ejemplo diferente a PHPExcel
Código php:
Ver original<?php
header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-Type: application/force-download"); header("Content-Type: application/octet-stream"); header("Content-Type: application/download"); header("Content-Type: application/vnd.ms-excel"); header('Content-Disposition: attachment; filename="nombre.xls"');
$s = "SELECT * FROM tabla";
$bodyTable = "<tr>
<th NOWRAP>Employee Number</th>
<th NOWRAP>Transaction Code</th>
<th NOWRAP>Date</th>
<th NOWRAP>Count</th>
</tr>";
$bg=($bg=='E2E2F2'?'F2F2FF':'E2E2F2');
$bodyTable .= "<tr>
<td bgcolor='#".$bg."' NOWRAP align='center'>".$row["columna1"]."</td>
<td bgcolor='#".$bg."' NOWRAP align='center'>".$row["columna2"]."</td>
<td bgcolor='#".$bg."' NOWRAP align='center'>".$row["columna3"]."</td>
<td bgcolor='#".$bg."' NOWRAP align='center'>".$row["columna4"]."</td>
</tr>";
}
$setBody = <<< BHD
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-type" content="text/html;charset=utf-8" />
</head>
<body>
<div id="MainExcelDiv" align="center" x:publishsource="Excel">
<table x:str border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse">
{$bodyTable}
</table>
</div>
</body>
</html>
BHD;
echo $setBody;
Tambien te añado que lo mejor es trabajar con CSV, no se si lo has pensando usar o si es obligado usar xls.