我的1
文件中有2张。我需要打开工作表编号foreach
并使用数据克隆它,就像我Message: Workbook already contains a worksheet named 'otchet-shablon'. Rename this worksheet first.
循环一样。
{
"collection": [
{
"nr": "99990655",
"machine": "Test A"
},
{
"nr": "123435546",
"machine": "Test B"
}
]
}
答案 0 :(得分:1)
重命名克隆的工作表(它仍然与原始名称相同,因为它是克隆) 之前 将其添加到PHPExcel对象
$activeSheet = $objPHPExcel->getActiveSheet();
$activeSheet1 = clone $activeSheet;
$activeSheet1->setTitle('New worksheet title')
$objPHPExcel->addSheet($activeSheet1);