您尝试打开[fileName]的文件格式不同于 由文件扩展名
指定
每当我打开使用PHPExcel编写的xls文件时,我都会收到该消息..无论如何都要摆脱那个警告 ,使用过的代码
<?php
require_once ('C:\wamp\www\phpexcel sample\Classes\PHPExcel\IOFactory.php');
$objPHPExcel = new PHPExcel();
$objPHPExcel->getProperties()->setCreator("7asobate")->setDescription("PHPExcel tryout");
$objPHPExcel->setActiveSheetIndex(0)->setTitle("7asobate worksheet")->setCellValue('A1' , 'someValue1')
->setCellValue('A2' , 'someValue2');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel , 'Excel2007');
$objWriter->save('F:\myFile.xls');
?>