Describe the bug
When new workbook is created without sheets inside, it can't be written;
wb.write("test.xlsx", function(err, stats) {
if (err) {
console.error(err);
} else {
console.log(stats); // Prints out an instance of a node.js fs.Stats object
}
});
Describe the bug When new workbook is created without sheets inside, it can't be written;
https://github.com/natergj/excel4node/blob/f359412b3d3769ce338f00dfab75c5f80b9f6336/source/lib/workbook/builder.js#L584
It is failed on this line. When I replaced it with
promiseObj.wb.addWorksheet();
, it worked just fine.To Reproduce Just create the new workbook without sheets inside.
Expected behavior If wb.sheets.length === 0, create first sheet with .addWorksheet method.
Environment (please complete the following information):