求助,PHPEXCEL如何删除单元格批注?

我是HE 2020-04-27 04:21:32
$newComment = new PHPExcel_RichText;
$this->excel->getActiveSheet()->getComment($cell)->setText($newComment); //将批注内容设置称空白
目前用了上面两句代码,批注还在,只是内容变成了空白,有没有大神知道怎么将批注移除掉?我看了PHPExcel_Worksheet下没有removeComment的方法
...全文
83 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
我是HE 2020-04-27
  • 打赏
  • 举报
回复 1
自己搞定了,用setComments方法给个空array就行了 记录一下 // 删除所有批注 public function delComment() { $newComment = array(); $this->excel->getActiveSheet()->setComments($newComment); }

21,881

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧