Error occurred on saving new excel file using exceljs writeBuffer

567 views Asked by At

I am using exceljs library in my angular/electron project and I am trying to save a new updated excel file but an error occurred.

enter image description here

my code:

const workbook = new Excel.Workbook();
const data = await fs.promises.readFile('item.xlsx');
const wb = await workbook.xlsx.load(data.buffer);
const worksheet = wb.getWorksheet('Order');
const buffer = await wb.xlsx.writeBuffer();
const blob = new Blob([buffer]);
FileSaver.saveAs(blob, `${Date.now()}.xlsx`);

any suggestions.

0

There are 0 answers