我使用PHPExcel来读取Excel-Spreadsheet文件及其值。到目前为止它运作良好。可以读取所有值,甚至是简单公式的结果值:=B3
然而,使用更复杂的公式,例如=VLOOKUP(B1,V3:W20,2,FALSE)
PHPExcel返回#N/A
,尽管在Excel工作表中确实存在真正的价值。
以下是代码的相关部分:
include_once('include/PHPExcel/IOFactory.php');
$inputFileType = PHPExcel_IOFactory::identify($strFileTemp);
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
$objPHPExcel = $objReader->load("$ppath/update");
$sheetData = $objPHPExcel->getActiveSheet()->toArray(null,true,true,true);
$value = $sheetData[1]['A'];
echo "<br>value:".$value."<br>";
我不提供一些特殊的价值命令吗?