首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >调用未定义方法PHPExcel::sheetCodeNameExists() PHPExcel

调用未定义方法PHPExcel::sheetCodeNameExists() PHPExcel
EN

Stack Overflow用户
提问于 2019-03-12 07:01:00
回答 1查看 1.5K关注 0票数 0

我正在使用Laravel4.2中的PHPExcel 1.8.0库。直到现在它还很好,但是现在我突然收到了这个错误。

在/var/www/myfilerunner/vendor/phpoffice/phpexcel/Classes/PHPExcel/Worksheet.php中“调用未定义的方法PHPExcel::sheetCodeNameExists()”

这是我在Worksheet.php中的代码

如果($this->getParent()) {

代码语言:javascript
复制
        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中。请帮我一把。

EN

回答 1

Stack Overflow用户

发布于 2019-03-12 07:11:49

获得此错误的原因有几个。

其中之一是PHPExcel的旧版本。请更新版本。

基于PHPExcel的GitHub存储库

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55115775

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档