Quantcast
Channel: NPOI
Viewing all articles
Browse latest Browse all 1621

Commented Issue: [Bug] Broken named ranges after existing file modification [13165]

$
0
0
I tried to open existing xlsx file (from excel 2007) and alter named ranges (can be specified in excel in Formulas/Name manager).

Problem is that when file is saved, all names' scope is changed to Sheet instead of whole Workbook. It breaks existing expressions.

Primary issue seems to be in CT_DefinedName class, Parse method is setting fields
ctObj.localSheetId = XmlHelper.ReadUInt(node.Attributes["localSheetId"]);
ctObj.localSheetIdFieldSpecified = node.Attributes["localSheetId"] != null;

while Write method always set localSheedId even if it was not originally present - it causes that field is set to 0 and scope is set to 1st sheet instead of workbook. There should be some check if localSheetIdFieldSpecified is set.
XmlHelper.WriteAttribute(sw, "localSheetId", this.localSheetId, true);


Btw, another bug is that expression "=SHEET_NAME!defined_name" cannot be parsed by NPOI, it fails with error that reference is expected. Expression "=defined_name" works but I cannot use it as it works with global scope names only.
Comments: ** Comment from web user: tonyqus **

This will be fixed in new release


Viewing all articles
Browse latest Browse all 1621

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>