0

I have an Excel template which has a table to be filled-up (e.g. A1:C10, 10 rows). I fill up its rows using NPOI in C#. Cells of Column C has a formula that is referencing to other cells (e.g. =SUM(A1:B1)). I also use evaluator.EvaluateFormulaCell(c) to evaluate the formula after writing to cells A&B.

Most of the time, I only write a few rows (e.g. 4 rows) for this table so the other row cells are blank. When this file is saved and opened, it prompts with "We found a problem with some content in 'MyExcel.xlsx'. Do you want us to try to recover as much as we can? If you trust the source of this work book, click Yes."

Clicking yes, it prompts again with: Removed Records: Shared formula from /xl/worksheets/sheet1.xml part Removed Records: Formula from /xl/calcChain.xml part (Calculation properties)

The Column C formula is also gone for rows 5 to 10.

When I fill up the whole table, I do not encounter this. When I use evaluator.EvaluateInCell(c) I do not encounter this also, but yes all the formula is gone.

What could be the exact problem? How to retain the formula with blank references without any errors? Thanks!

jr0115
  • 31
  • 1
  • 4
  • Welcome to SO. I'd recommend taking [the tour](https://stackoverflow.com/tour) and then reading [How to Ask](https://stackoverflow.com/help/how-to-ask) and [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) as an introduction to how SO works, and how to effectively ask a question. – Markus Deibel May 23 '19 at 06:32
  • Can you share the code and what you tried till now? – Krishna Chaithanya Muthyala Jun 26 '19 at 15:59

0 Answers0