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

Italian function 'DATA.MESE' not correctly mapped on EDATE #1270

Open
1 task
Zax opened this issue Feb 21, 2024 · 4 comments
Open
1 task

Italian function 'DATA.MESE' not correctly mapped on EDATE #1270

Zax opened this issue Feb 21, 2024 · 4 comments

Comments

@Zax
Copy link

Zax commented Feb 21, 2024

NPOI Version

v2.6.2

File Type

  • XLS

Upload the Excel File

EDATEBug.xls

Reproduce Steps

  1. Open excel file
  2. workbook.EvaluateAllFormulas() -> throw exception "NPOI.SS.Formula.Eval.NotImplementedFunctionException : DATA.MESE"

Issue Description

DATA.MESE is Italian translation of EDATE formula, but NPOI does not recognize it correctly.

For now, I use this workaround:

workbook.EvaluateAllFormulas();
Assert.Catch(workbook.EvaluateAllFormulas); // <- throw exception
// workaround - mapped manually
var udfs = new DefaultUDFFinder(["DATA.MESE"], [EDate.Instance]);
var udfToolpack = new AggregatingUDFFinder(udfs);
workbook.AddToolPack(udfToolpack);
workbook.EvaluateAllFormulas(); // <- work fine
@Zax Zax added the bug label Feb 21, 2024
@Bykiev
Copy link
Collaborator

Bykiev commented Feb 22, 2024

I believe that excel file shouldn't contain any localized data, it's always in English and only the Excel App is localized and shows the data according to you region settings. How did you get the original file? WPS office shows the cell with formula contains unknown text, though MS Excel can parse it.

@Zax
Copy link
Author

Zax commented Feb 23, 2024

I'm also pretty sure that the non-localized formula (EDATE) is in the excel file. I also did a test in VBA with the control expression and the formula in the cell gives me "=EDATE(A1,1)".
I created the Excel sheet directly with Excel 2016 (Italian) and saved it in Excel 97-2003 (xls) format. Now I'm uploading a test project here on Github.

Here my test project:
https://github.com/Zax/EDataTest

@tonyqus
Copy link
Member

tonyqus commented Feb 24, 2024

Is this the only translated function Microsoft Excel provided? Or there are a few?

@Bykiev
Copy link
Collaborator

Bykiev commented Apr 27, 2024

@Zax, I've researched the issues and test project in your repo, can you please remove the Implicit intersection operator in formula and save it again? It seems this operator is only supported by Microsoft 365 and MS Excel 2016+ and incorrectly translated to old xls format while exporting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants