-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Unable to Evaluate Formula while referencing an external workbook #1442
Comments
What's FileName.xlsx here? Is it another Excel file? Please provide the original Excel file. Otherwise, it's hard to reproduce the issue. |
Hey @tonyqus, Thanks for your response! Currently, I’m using a template with all the formulas built into it. I have another Excel file containing the data. First, I make a copy of the template, and then I paste the values into the copy to evaluate the results. However, it seems that Excel is referencing the other file (template) and giving me an error. As mentioned earlier, this doesn’t happen when we do the same thing with Microsoft.Office.Interop.Excel, possibly because Excel handles it automatically in that case |
NPOI is NOT Microsoft Office. The formula engine is reimplement in C# (originally implemented in Aapche POI in Java). And the logic of the embeded formula calculation engine is very complicated. We cannot guarantee all the behaviors are same. If the formula is too complicated, it is possible that NPOI cannot parse or evaluate it. |
But again, if you cannot provide the original Excel, I can't guess what's wrong. |
I understand. I also find the formula quite confusing. I added a workaround by manually inserting the formula using the |
NPOI Version
2.7.1
File Type
XLSX
Issue Description
When I attempt to evaluate a formula using NPOI, I encounter the following error:
Formula
Formula as read by NPOI:
Formula as seen in the Excel UI:
Steps to Reproduce
Expected Behavior
The formula should evaluate correctly without errors.
Actual Behavior
I get the following error message:
"Could not resolve external workbook name 'FileName.xlsx'. Workbook environment has not been set up."
Temporary Workaround
To remove the error, I manually remove
[1]
from the entire workbook using NPOI. However, after doing this, the formula no longer throws an error but also does not return any result in the cell.Additional Notes
The text was updated successfully, but these errors were encountered: