PhpExcel 删除默认的Sheet
生活随笔
收集整理的這篇文章主要介紹了
PhpExcel 删除默认的Sheet
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
最近使用ThinkPHP的第三方插件PheExcel導(dǎo)出多語言文件,但導(dǎo)出的文檔中最后一個(gè)Sheet并不是我Code生成的 因?yàn)閷?dǎo)出后的文件編輯后會(huì)再導(dǎo)入到系統(tǒng)中,因此對于該sheet必須刪除掉[經(jīng)測試”Worksheet“是PhpExcel自動(dòng)生成的] $this->phpExcel = new \PHPExcel();
// remove 1st sheet
// remove default sheet [title=wordsheet]
$this->phpExcel->removeSheetByIndex(0);
//create sheet and more code
$objPHPExcel->createSheet(0)->setTitle('sheet1');
// more code.....
參考: PHPExcel: Delete sheets PHPExcel Check if sheet exists PHPExcel:removeSheetByIndex
轉(zhuǎn)載于:https://www.cnblogs.com/huangtailang/p/5666773.html
總結(jié)
以上是生活随笔為你收集整理的PhpExcel 删除默认的Sheet的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 成语故事120篇简单
- 下一篇: CODE[VS]-求和-整数处理-天梯青