0

I was trying to read an excel sheet from nodejs and would like to insert a value to a particular cell of my excel sheet. I tried the below code. But it gives me error

   const XLSX = require('xlsx');
let workbook = XLSX.readFile('newTest.xlsx');
let first_sheet_name = workbook.SheetNames[0];
let worksheet = workbook.Sheets[first_sheet_name];
let cell = worksheet['AW2'].v;
console.log(cell)
worksheet['AW2'].v = 'test';
learnNcode
  • 141
  • 3
  • 12
  • Does this answer your question? [How to write into a particular cell using xlsx npm package](https://stackoverflow.com/questions/51441138/how-to-write-into-a-particular-cell-using-xlsx-npm-package) – Ervin Szilagyi May 09 '20 at 14:43
  • I tried the code but worksheet['AW2'].v ----this gives me error TypeError: Cannot read property 'v' of undefined – learnNcode May 09 '20 at 15:01

0 Answers0