Edit worksheet that contain protected cell, cause the result cell filled with NAN
Hi,
I have a workbook (attached: items_2017-10-04.xlsx) that contain some protected cell inside the worksheet. I can read the protected cell, but can't edit it.
I use js-xlsx to manipulate some of the unprotected cell, and then save the workbook to a new file.
Everything work fine. The protected cell lost it's protected status, but it doesn't matter for my use case.
The only problem is, if the protected cell is empy, then the same cell at the new file will be filled with NaN text.
The worksheet has many cells that are explicitly marked as number but have no data or formula. We'll push a fix shortly.
Once the tests pass, we'll push the release to NPM.
The empty cells will not be generated by default when you read the workbook, so you may have to go back and create new cell objects if you intended to write to one of those cells. For example, G3 is empty. You can add it back by setting the worksheet G3 property to a cell:
workbook.Sheets['Sheet1']['G3'] = { t:'n', v:12345 };
You can force cell object generation by setting sheetStubs:true, but those will show up as stubs like { t: 'z' }, so you'd have to set the type to 'n' whenever you want to assign a value.
Yes. Thank you.