Correct way to update a named cell using c# .net openxml sdk 2.5?

Viewed 64

I think I am looking to do something simple: Update a named cell inside a workbook using openxml sdk.

The background: workbooks are received via email and contain a named cell called totalCredit that needs to be updated with the correct value and returned back to its sender.

What I have so far is:

  1. Locate the DefinedName
  2. Extracted the cell reference from the InnerXml property (split by ! then by $)
  3. Locate the cell under the worksheet with the parsed cell reference
  4. Update the CellValue with a new CellValue

This looks too convoluted. Is there a safer / easier way?

0 Answers
Related