[GH-ISSUE #38] Feature request: worksheet_write_comment() #33

Closed
opened 2026-05-05 11:26:41 -06:00 by gitea-mirror · 10 comments
Owner

Originally created by @jmcnamara on GitHub (Dec 10, 2015).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/38

Originally assigned to: @jmcnamara on GitHub.

Add worksheet_write_comment() function like the Python XlsxWriter Worksheet method write_comment().
See https://xlsxwriter.readthedocs.io/working_with_cell_comments.html

  • Difficulty: 5 (Easy 1 - 5 Hard)
  • Priority: 3 (High 1 - 5 Low)

Add +1 as a comment to vote for this feature and to get an update when it is implemented.

If you would like to make a donation to accelerate this feature you can do so via PayPal or contact me directly. Currently $0 of $800.

Originally created by @jmcnamara on GitHub (Dec 10, 2015). Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/38 Originally assigned to: @jmcnamara on GitHub. Add `worksheet_write_comment()` function like the Python XlsxWriter Worksheet method `write_comment()`. See https://xlsxwriter.readthedocs.io/working_with_cell_comments.html - Difficulty: 5 (Easy 1 - 5 Hard) - Priority: 3 (High 1 - 5 Low) Add +1 as a comment to vote for this feature and to get an update when it is implemented. If you would like to make a donation to accelerate this feature you can do so via [PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ATE9EFWNF7PBJ) or contact me [directly](jmcnamara@cpan.org). Currently $0 of $800.
gitea-mirror 2026-05-05 11:26:41 -06:00
Author
Owner

@scottyd57 commented on GitHub (Jul 25, 2018):

I would be willing to look into this feature. I need this to process my excel files. Let me know if I can help.

<!-- gh-comment-id:407931032 --> @scottyd57 commented on GitHub (Jul 25, 2018): I would be willing to look into this feature. I need this to process my excel files. Let me know if I can help.
Author
Owner

@jmcnamara commented on GitHub (Jul 27, 2018):

Let me know if I can help.

Thanks for the offer. Libxlsxwriter is mainly a port of the Python and Perl libraries that I wrote. I have the tests, docs and an API so in general I don't need help.

What I do need is time to work on it and I've had even less of that recently than usual.

<!-- gh-comment-id:408356474 --> @jmcnamara commented on GitHub (Jul 27, 2018): > Let me know if I can help. Thanks for the offer. Libxlsxwriter is mainly a port of the Python and Perl libraries that I wrote. I have the tests, docs and an API so in general I don't need help. What I do need is time to work on it and I've had even less of that recently than usual.
Author
Owner

@jmcnamara commented on GitHub (Aug 6, 2018):

Since I've had a few requests about this I've added a note about making donations to prioritize this feature.

<!-- gh-comment-id:410818391 --> @jmcnamara commented on GitHub (Aug 6, 2018): Since I've had a few requests about this I've added a note about making donations to prioritize this feature.
Author
Owner

@LifeToDevice commented on GitHub (Dec 5, 2018):

+1

<!-- gh-comment-id:444376787 --> @LifeToDevice commented on GitHub (Dec 5, 2018): +1
Author
Owner

@sevenyang2019 commented on GitHub (Jul 2, 2019):

can libxlsxwriter support the function of write_comments now ?

<!-- gh-comment-id:507582922 --> @sevenyang2019 commented on GitHub (Jul 2, 2019): can libxlsxwriter support the function of write_comments now ?
Author
Owner

@jmcnamara commented on GitHub (Jul 2, 2019):

@sevenyang2019 No. This issue would be closed if it was completed or updated if there was some progress.

<!-- gh-comment-id:507632399 --> @jmcnamara commented on GitHub (Jul 2, 2019): @sevenyang2019 No. This issue would be closed if it was completed or updated if there was some progress.
Author
Owner

@jmcnamara commented on GitHub (Jan 5, 2020):

The initial version of comment support is available on the "vml" branch. You can now add comments to libxlsxwriter cells as follows:

#include "xlsxwriter.h"

int main() {

    lxw_workbook  *workbook  = workbook_new("comments1.xlsx");
    lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);

    worksheet_write_string( worksheet, 0, 0, "Hello" , NULL);

    worksheet_write_comment(worksheet, 0, 0, "This is a comment");

    return workbook_close(workbook);
}

And get output like this:

comments1

It only works when lxw_workbook_options constant_memory = LXW_FALSE (which is the default).

I'll be adding more options and documentation in the next week or so but if anyone is feeling brave and would like to try it let me know how you get on.

The eventual functionality will be like XlsxWriter: https://xlsxwriter.readthedocs.io/working_with_cell_comments.html

<!-- gh-comment-id:570959446 --> @jmcnamara commented on GitHub (Jan 5, 2020): The initial version of comment support is available on the "vml" branch. You can now add comments to libxlsxwriter cells as follows: ```C #include "xlsxwriter.h" int main() { lxw_workbook *workbook = workbook_new("comments1.xlsx"); lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL); worksheet_write_string( worksheet, 0, 0, "Hello" , NULL); worksheet_write_comment(worksheet, 0, 0, "This is a comment"); return workbook_close(workbook); } ``` And get output like this: ![comments1](https://xlsxwriter.readthedocs.io/_images/comments1.png) It only works when lxw_workbook_options constant_memory = LXW_FALSE (which is the default). I'll be adding more options and documentation in the next week or so but if anyone is feeling brave and would like to try it let me know how you get on. The eventual functionality will be like XlsxWriter: https://xlsxwriter.readthedocs.io/working_with_cell_comments.html
Author
Owner

@jmcnamara commented on GitHub (Jan 7, 2020):

I've added some additional functionality, more tests, and merged this up to master. Docs and further examples to be added. Note, please don't use the vml branch anymore since it has an issue.

<!-- gh-comment-id:571821918 --> @jmcnamara commented on GitHub (Jan 7, 2020): I've added some additional functionality, more tests, and merged this up to **master**. Docs and further examples to be added. Note, please don't use the vml branch anymore since it has an issue.
Author
Owner

@jmcnamara commented on GitHub (Jan 11, 2020):

The final version of this feature is now on master with docs and examples if anyone wants to try it. I will push it out to the packagers in the next few days.

<!-- gh-comment-id:573332777 --> @jmcnamara commented on GitHub (Jan 11, 2020): The final version of this feature is now on master with docs and examples if anyone wants to try it. I will push it out to the packagers in the next few days.
Author
Owner

@jmcnamara commented on GitHub (Jan 13, 2020):

Upstream in version 0.92/0.93.

<!-- gh-comment-id:573930838 --> @jmcnamara commented on GitHub (Jan 13, 2020): Upstream in version 0.92/0.93.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/libxlsxwriter#33
No description provided.