解决办法是在PHPExcel_Style_Alignment 和PHPExcel_Style_Border 前面加上"\"符号,就完美解决了
$objPHPExcel->getActiveSheet()->getStyle('A')->getAlignment()->setHorizontal(\PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
在thinkphp的使用中最后的 PHPExcel_Style_Alignment::HORIZONTAL_CENTER 要写成
\PHPExcel_Style_Alignment::HORIZONTAL_CENTER才能调用到。