I have an excel file with a lot of scripts (office scripts). These scripts are linked with buttons inside the body of the excel file. I have written an Javascript app that I execute thought 'NodeJS'. This javascript reads the excel file, it makes some calculations and later the app put some results in the excel file (I use exceljs). The problem is that when I open the excel file, the buttons with the scripts have disappeared!. Can anyone help me! Thanks in advance.
const ExcelJS = require('exceljs');
const wb = new ExcelJS.Workbook();
const fileName = 'Book.xlsx';
(async () => {
await wb.xlsx.readFile(fileName);
const ws = wb.getWorksheet('RenM1ACont');
const S_Bruto_00 = Number(ws.getCell('I69').value);
ws.getCell('E61').value= tipoNumber;
await wb.xlsx.writeFile(fileName);
})
Excel file with buttons
As can be seen in the image, before the program is run, the Excel file contains buttons with associated scripts. When the program is run through NodeJS, everything is correct except that the buttons, all of them, have disappeared and with them the scripts associated with each button.
I have an excel file with a lot of scripts (office scripts). These scripts are linked with buttons inside the body of the excel file. I have written an Javascript app that I execute thought 'NodeJS'. This javascript reads the excel file, it makes some calculations and later the app put some results in the excel file (I use exceljs). The problem is that when I open the excel file, the buttons with the scripts have disappeared!. Can anyone help me! Thanks in advance.
const ExcelJS = require('exceljs');
const wb = new ExcelJS.Workbook();
const fileName = 'Book.xlsx';
(async () => {
await wb.xlsx.readFile(fileName);
const ws = wb.getWorksheet('RenM1ACont');
const S_Bruto_00 = Number(ws.getCell('I69').value);
ws.getCell('E61').value= tipoNumber;
await wb.xlsx.writeFile(fileName);
})
Excel file with buttons
As can be seen in the image, before the program is run, the Excel file contains buttons with associated scripts. When the program is run through NodeJS, everything is correct except that the buttons, all of them, have disappeared and with them the scripts associated with each button.
Share Improve this question asked Mar 8 at 1:45 PcouperPcouper 111 silver badge4 bronze badges1 Answer
Reset to default 0It’s likely that ExcelJS doesn’t recognize buttons, so it ignores them when parsing your file. As a result, when it writes the file back, it includes everything except the buttons
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744905383a4600223.html
评论列表(0条)