let workbook = new Excel.Workbook();
for (let i = 0; i < 3; i++){
workbook.addWorksheet('test', {
properties: {tabColor: {argb: 'FF00FF00'}}, views: [
{ySplit: 5, activeCell: 'A1', showGridLines: false}
]
});
}
第一个工作表将具有“测试”名称,其他工作表将具有错误标题。你知道如何让它工作吗?
编辑:如果我在函数中生成我的工作表,它可以工作。
let workbook = new Excel.Workbook();
function generateWorksheet(data){
workbook.addWorksheet('test', {
properties: {tabColor: {argb: 'FF00FF00'}}, views: [
{ySplit: 5, activeCell: 'A1', showGridLines: false}
]
});
}
for (let i = 0; i < 3; i++){
generateWorksheet(i);
}