2

Have created an application using nodejs(npm excelJs), which writes the data to an excel sheet(which includes validations and automatic calculations).

for example:I have a column called "type" in my excel which have a validation of: { type: 'list', formulae: [ '"A,B,C,D"', '0' ], allowBlank: true, showInputMessage: true, showErrorMessage: true, errorStyle: 'stop' }

Based on the "type" the total amount will be calculated.

But when i try to insert the value to "type" using the code below WorkSheet.getRow(row).findCell(cell + 3).value = "A"; the value is just inserting but the total value is not calculating.

what am i missing here?can anyone explain how to select a value from a list in a excel column using the node?

1 Answers1

0

To add a formula to a cell you must use the formula property.

cpyWorkSheet.getRow(row).findCell(cell + 3).value = { formula: "Support(L1_L2)" };
David Jones
  • 2,879
  • 2
  • 18
  • 23
  • Thanks for the reply. have tried the above but getting like this in the cell #NAME? and when i double clicked on the cell am getting "=support(l1_l2)" – akarshgowda Jan 09 '23 at 17:29
  • FYI, the excel sheet already have a formula i.e { type: 'list', formulae: [ '"A,B,C,D"', '0' ], allowBlank: true, showInputMessage: true, showErrorMessage: true, errorStyle: 'stop' }. I just need to insert a value to that particular cell which have above validation. – akarshgowda Jan 10 '23 at 07:29