Open Xenorage opened 4 years ago
Saving styles are not supported or is this a bug? var buf = fs.readFileSync("tes2.xls"); // console.log("input", input); const wb = XLSX.read(buf, { type: "buffer", cellText: false, cellDates: true, cellStyles: true }); wb.Sheets[wb.SheetNames[1]]['D5'].s= { patternType: 'solid', fgColor: { rgb: '969696' }, bgColor: { rgb: '000000' } }; XLSX.writeFile(wb,"tes3.xls", {cellStyles:true});
If I understand your issue correctly, the following code might be helpful: wb.Sheets[wb.SheetNames[1]]['D5'].s = { "fill": { "fgColor": { "rgb": "969696" }, "bgColor": { "rgb": '000000' } } };
Saving styles are not supported or is this a bug? var buf = fs.readFileSync("tes2.xls"); // console.log("input", input); const wb = XLSX.read(buf, { type: "buffer", cellText: false, cellDates: true, cellStyles: true }); wb.Sheets[wb.SheetNames[1]]['D5'].s= { patternType: 'solid', fgColor: { rgb: '969696' }, bgColor: { rgb: '000000' } }; XLSX.writeFile(wb,"tes3.xls", {cellStyles:true});