phpexcel 导出多个sheet报错 (度娘没有找到办法)

新手上路,请多包涵

phpexcel循环导出多个sheet,设置2个sheet正常,当设置第3个sheet时,报错“You tried to set a sheet active by the out of bounds index: 2. The actual number of sheets is 2”,下面部分代码及说明:

clipboard.png

然后循环创建sheet

clipboard.png

然后往sheet里添加数据,当setactivesheetindex(2)时会报错,截图如下:

clipboard.png

在百度上找了一圈也没找到办法,求大神指点~

阅读 6.4k
2 个回答
$objPHPExcel->createSheet();
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题