我正在使用Laravel4.2中的PHPExcel 1.8.0库。直到现在它还很好,但是现在我突然收到了这个错误。
在/var/www/myfilerunner/vendor/phpoffice/phpexcel/Classes/PHPExcel/Worksheet.php中“调用未定义的方法PHPExcel::sheetCodeNameExists()”
这是我在Worksheet.php中的代码
如果($this->getParent()) {
if ($this->getParent()->sheetCodeNameExists($pValue)) {
if (PHPExcel_Shared_String::CountCharacters($pValue) > 29) {
$pValue = PHPExcel_Shared_String::Substring($pValue,0,29);
}
$i = 1;
while ($this->getParent()->sheetCodeNameExists($pValue . '_' . $i)) {
++$i;
if ($i == 10) {
if (PHPExcel_Shared_String::CountCharacters($pValue) > 28) {
$pValue = PHPExcel_Shared_String::Substring($pValue,0,28);
}
} elseif ($i == 100) {
if (PHPExcel_Shared_String::CountCharacters($pValue) > 27) {
$pValue = PHPExcel_Shared_String::Substring($pValue,0,27);
}
}
}
$pValue = $pValue . '_' . $i;// ok, we have a valid name
>setTitle($altTitle,$updateFormulaCellReferences);
}
}我没有更改任何版本,而且这个方法存在于我的PHPExcel.php中。请帮我一把。
发布于 2019-03-12 07:11:49
https://stackoverflow.com/questions/55115775
复制相似问题