mirror of
https://github.com/jmcnamara/libxlsxwriter.git
synced 2026-05-15 14:15:54 -06:00
[GH-ISSUE #121] worksheet_write_string raises error for empty string string #102
Labels
No labels
awaiting user feedback
bug
cmake
cmake
docs
feature request
in progress
long term
medium term
medium term
pull-request
question
question
ready to close
short term
under investigation
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/libxlsxwriter#102
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jeroen on GitHub (Aug 22, 2017).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/121
Originally assigned to: @jmcnamara on GitHub.
I found that
worksheet_write_string()raises an error when inserting an empty string""value:In my data the empty string
""is an actual value and different from no valueNULL. Does Excel not support empty strings?@jmcnamara commented on GitHub (Aug 22, 2017):
No.
Excel ignores empty strings unless it has a format. This allows you to format blank cells as part of a formatted area. But blank or empty strings without formatting are never stored by Excel.
So libxlsxwriter returns an error/warning to let the user know that the parameter is being ignored.
However, the error probably isn't correct in this case since you aren't passing a
NULL. It should probably say something like:I'll add a new warning for that.
@jeroen commented on GitHub (Aug 22, 2017):
So the only way to store an empty string is make it e.g. bold?
@jmcnamara commented on GitHub (Aug 22, 2017):
Yes. A empty string without formatting isn't stored by Excel. It just ignores them.
@jmcnamara commented on GitHub (Aug 30, 2017):
After thinking about this for a bit I've changed the code to just ignore unformatted empty or NULL strings without a warning/error. This is in line with what Excel does.