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

SetCellFormula produces a bad formula if you use quotes #566

Closed
af-engineering opened this issue Jan 22, 2020 · 4 comments
Closed

SetCellFormula produces a bad formula if you use quotes #566

af-engineering opened this issue Jan 22, 2020 · 4 comments
Labels
needs more info This issue can't reproduce, need more info

Comments

@af-engineering
Copy link

af-engineering commented Jan 22, 2020

Formula: =TEXTJOIN(", ", TRUE, UNIQUE(SORT(C11:C88)))

If I set this formula in Excel, unzip the xlsx file and look at the sheet XML, I see

<f>_xlfn.TEXTJOIN(", ", TRUE, _xlfn.UNIQUE(_xlfn._xlws.SORT(C11:C88)))</f>

If I set the same formula using Excelize, I see

<f>=TEXTJOIN(&#34;, &#34;, TRUE, UNIQUE(SORT(C11:C88)))</f>

There may be other differences elsewhere that also effects this.

@xuri
Copy link
Member

xuri commented Jan 22, 2020

Hi @af-engineering, thanks for your feedback, which version of the Excelize are you using? Please try to use the master branch code. The SORT function is one of several beta features, and currently only available to a portion of Office Insiders at this time.

@af-engineering
Copy link
Author

We were using v2.0.2, but I just switched to master and it results in the same error. Here's what happens when you try to open the file:

Screen Shot 2020-01-22 at 10 07 09 AM

@xuri
Copy link
Member

xuri commented Jan 24, 2020

Hi @af-engineering, try to using =_xlfn.TEXTJOIN(", ", TRUE, _xlfn.UNIQUE(_xlfn._xlws.SORT(C11:C88))) in the SetCellFormula function, I have tested and it works well. If not, please provide file attachments without sensitive info, and version of your Excel application.

@xuri xuri added the needs more info This issue can't reproduce, need more info label Jan 24, 2020
@af-engineering
Copy link
Author

That does work. Thanks for the workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info This issue can't reproduce, need more info
Projects
None yet
Development

No branches or pull requests

2 participants