Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erroneous parsing of defined names #18

Closed
rjplevin opened this issue May 8, 2018 · 7 comments
Closed

Erroneous parsing of defined names #18

rjplevin opened this issue May 8, 2018 · 7 comments
Labels
bug Something isn't working

Comments

@rjplevin
Copy link

rjplevin commented May 8, 2018

I have a workbook that has traveled through many hands, so I don't know the origins of these "hidden" defined names, but they're breaking XLSX.jl. I replaced the error() at the end of parse_workbook! with println("Could not parse named range '$(ref_or_range_str)' in $defined_name_node."), yielding this:

Could not parse named range '2' in <definedName name="lssolver_est" localSheetId="1" hidden="1">2</definedName>.
Could not parse named range '1000' in <definedName name="lssolver_itr" localSheetId="1" hidden="1">1000</definedName>.
Could not parse named range '0' in <definedName name="lssolver_neg" localSheetId="1" hidden="1">0</definedName>.
Could not parse named range '0.000001' in <definedName name="lssolver_piv" localSheetId="1" hidden="1">0.000001</definedName>.

...

I don't know the meaning of "hidden" defined names, but the parser seems to be interpreting the value incorrectly as the name of the range.

@felipenoris
Copy link
Owner

@rjplevin Thank you for finding this bug! I'll take a look at it shortly.

@felipenoris
Copy link
Owner

@rjplevin If you use this formula in a Cell: =lssolver_est , does it show 2 as a result?

@felipenoris felipenoris added the bug Something isn't working label May 8, 2018
@rjplevin
Copy link
Author

rjplevin commented May 8, 2018

Oddly, no.

I can email you the workbook; I'd rather not attach it here for all of eternity. :~) Email me at plevin@berkeley.edu...

@felipenoris
Copy link
Owner

Sure! Just sent you an email.

@felipenoris
Copy link
Owner

felipenoris commented May 8, 2018

Cool! After looking in the internet for examples like these, I see 3 Workbook features not covered by XLSX.jl. I'll work on them ASAP:

  • Worksheet level names
  • Names associated with constant values, instead of cell ranges
  • hidden names.

The fact that it is a hidden name it just means that it doesn't show in the Insert -> Name -> Define Name menu. To change them you have to use VBA. But it works just like any other defined named, and you can reference them from formulas. I guess it was created by an Add-in that is an optimizer in your case.

Just give me some time and I'll fix this in the package.

Thanks!

@felipenoris
Copy link
Owner

felipenoris added a commit that referenced this issue May 8, 2018
felipenoris added a commit that referenced this issue May 9, 2018
Support for local worksheet names and constants (#18)
@felipenoris
Copy link
Owner

@rjplevin, you're all set. You can read this file using the latest master version. Just use Pkg.checkout("XLSX") to get it. I'll tag a new version by the weekend.

Thanks for finding this bug!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants