Hola bueno tengo un problema con la generacion de un archivo en excel importado de una tabla en php. 
 
Esta tabla quiero mandar
 
<script type="text/javascript" src="jquery-1.3.2.min.js"></script> 
 
       <form action="ficheroExcel.php" method="post" target="_blank" id="FormularioExportacion">
        <p>Exportar a Excel  <img src="export_to_excel.gif" class="botonExcel" /></p>
        <input type="hidden" id="datos_a_enviar" name="datos_a_enviar" />
		</form>
 
    <table width="40%" border="1" cellpadding="0" bordercolor="#FFFFFF" bgcolor="#CCCCCC" id="Exportar_a_Excel">
      <tr>
        <td width="50%" class="Estilo2">RUT</td>
        <td width="50%" class="Estilo2">Puntos</td>
      </tr>
 
 
 
 
      <script language="javascript">
		$(document).ready(function() {
    	 $(".botonExcel").click(function(event) {
    	 $("#datos_a_enviar").val( $("<div>").append( $("#Exportar_a_Excel").eq(0).clone()).html());
   	  $("#FormularioExportacion").submit();
		});
		});
		</script>
 
 
 
y este es el fichero excel .php
 
<?php
header("Content-type: application/vnd.ms-excel; name='excel'");
header("Content-Disposition: filename=ficheroExcel.xls");
header("Pragma: no-cache");
header("Expires: 0");
echo $_POST['datos_a_enviar'];
?>
 
 
pasa que cuando voy a fichero excel.php me descarga un archivo en excel pero dice "no se puede leer el archivo" 
  
 
 No sé si resolviste el problema pero trata usando la librería PHPExcel. 

