$php_writer=newPHPExcel_Writer_Excel2007();
$php_excel_obj=$php_writer->getPHPExcel($file_name);
$current_sheet=$php_excel_obj->getSheet(0);
$all_column=$current_sheet->getHighestColumn();
$all_row=$current_sheet->getHighestDataRow();
$letter=array('A','B','C','D','E');
$data=array($_POST['inputName'],$_POST['inputClass'],$_POST['inputEmail'],$_POST['inputJob'],$_POST['inputTel']);
$objReader=PHPExcel_IOFactory::createReader("Excel2007");
$info=$objReader->listWorksheetInfo($file_name);
$row=$info[0]['totalRows'];
$all_row=$row;
$x=$all_row+1;
for($i=0;$i<count($data);$i++){
$current_sheet->setCellValue("$letter[$i]$x","$data[$i]");
}
$write=newPHPExcel_Writer_Excel2007($php_excel_obj);
header("Pragma:public");
header("Expires:0");
header("Cache-Control:must-revalidate,post-check=0,pre-check=0");
header("Content-Type:application/force-download");
header("Content-Type:application/vnd.ms-execl");
header("Content-Type:application/octet-stream");
header("Content-Type:application/download");;
header('Content-Disposition:attachment;filename="testdata.xls"');
header("Content-Transfer-Encoding:binary");
$write->save($file_name);