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

Function processing in XLSX #692

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

ilavloki
Copy link

Added processing for all data:
if (cell value starts with '=')
remove cell value
instead set function as value.substring(1)

also added example.
Have not checked XLS - it may not work

var cell = worksheet[cellName];
if (utils.hasContent(cell.v)) {
if(cell.v[0] == '=') {
cell.f = cell.v.toString().substring(1)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the "=" is removed, it will not get into the final Excel file. Then opening will not get it as a formula.
Did this work for you?

Copy link
Author

@ilavloki ilavloki May 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it works but only for XLSX format
Probably for XLS few modifications are needed
I've tried to launch index.html in Chrome and Edge
XLSX example:
image
in XLS format - it really doesn't work (and cells remain empty)
image

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it is not supported to write formula in XLS format at all :(
https://docs.sheetjs.com/docs/csf/features/formulae/

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

Successfully merging this pull request may close these issues.

2 participants