PerfectXL / PerfectXL-EPPlus

Our own fork of the EPPlus library
7 stars 4 forks source link

Fix corrupt defined names saved in XML #31

Closed WillemJann closed 4 years ago

WillemJann commented 4 years ago

EPPlus was using its internal name.NameFormula to save the defined names back to XML. However, this was giving incorrect results for some defined names with external references.

For example: <definedName name="Ticker">[1]Data!$A$2</definedName>

Was saved as: <definedName name="Ticker">[/Vishal/Business/Safal%20Niveshak/Investing%20Excels%20&amp;%20Templates/OSV_DCF_Spreadsheet_Free-20100715.xls]Data!$A$2</definedName>

This PR fixes this issue. Now name.RawFormula is used, which contains the original formula in XML.