我正在尝试编写一个脚本,将所有文件xls转换为csv,但是当我尝试运行它时,我会出现此错误
致命错误:未捕获的异常' PHPExcel_Reader_Exception'有消息'无法打开../public/mad/export_tarifs.xls进行阅读!文件不存在。'在第443行的C:\ wamp \ www \ chaima \ speed-wear.net \ web \ batchs \ Classes \ PHPExcel \ Reader \ Excel5.php
这是我的代码:
require_once 'Classes/PHPExcel/IOFactory.php';
$inputFileType = 'Excel5';
$inputFileName = '../public/mad/test_batch_solsys.xls';
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
$objPHPExcelReader = $objReader->load($inputFileName);
$loadedSheetNames = $objPHPExcelReader->getSheetNames();
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcelReader, 'CSV');
foreach($loadedSheetNames as $sheetIndex => $loadedSheetName) {
$objWriter->setSheetIndex($sheetIndex);
$objWriter->save($loadedSheetName.'.csv');
}