Unable to add more than one cell comment #2779

Closed
opened 2022-09-02 06:30:57 +00:00 by AbhinanduReddy · 5 comments
AbhinanduReddy commented 2022-09-02 06:30:57 +00:00 (Migrated from github.com)

I m trying to add cell comments in my angular project but and error pop shows
image
image

I m trying to add cell comments in my angular project but and error pop shows ![image](https://user-images.githubusercontent.com/43111492/188073072-691295bb-5698-4393-b1ff-9c0b1d31bd45.png) ![image](https://user-images.githubusercontent.com/43111492/188073127-b347b042-439e-4ef4-acf0-f9aab71285ba.png)
SheetJSDev commented 2022-09-02 06:34:46 +00:00 (Migrated from github.com)

What version of Excel are you using? Can you share the bad file as well as the comment structure for one of the comments that was removed?

Excel recently changed how comments worked, and SheetJS shifted to support the new threaded comments, so it's possible the fallback isn't compatible with some older versions.

What version of Excel are you using? Can you share the bad file as well as the comment structure for one of the comments that was removed? Excel recently changed how comments worked, and SheetJS shifted to support the new threaded comments, so it's possible the fallback isn't compatible with some older versions.
AbhinanduReddy commented 2022-09-02 06:42:30 +00:00 (Migrated from github.com)

Thank you for responding i have used the latest version now I'm not getting error, but Thereaded comments are coming blank now

Thank you for responding i have used the latest version now I'm not getting error, but Thereaded comments are coming blank now
AbhinanduReddy commented 2022-09-02 06:45:13 +00:00 (Migrated from github.com)

image
image

![image](https://user-images.githubusercontent.com/43111492/188075178-d69f1a42-bf06-40f0-986c-dcdf1446e71c.png) ![image](https://user-images.githubusercontent.com/43111492/188075239-0ec14df3-4f69-4892-80f6-1bd4e2e35f8a.png)
SheetJSDev commented 2022-09-02 06:52:14 +00:00 (Migrated from github.com)

What version of Excel are you using?

Also, can you test the attached file? comments_example.xlsx

It was generated as follows:

var wb = XLSX.utils.book_new();

var ws = XLSX.utils.aoa_to_sheet([["A1"], ["A2"]]);

if(!ws.A1.c) ws.A1.c = [];
ws.A1.c.push({a:"SheetJS", t:"This comment is visible"});

if(!ws.A2.c) ws.A2.c = [];
ws.A2.c.hidden = true;
ws.A2.c.push({a:"SheetJS", t:"This comment will be hidden"});

XLSX.utils.book_append_sheet(wb, ws, "Sheet1");


var ws = XLSX.utils.aoa_to_sheet([["A1"], ["A2"]]);

if(!ws.A1.c) ws.A1.c = [];
ws.A1.c.push({a:"SheetJS", t:"This is not threaded"});

if(!ws.A2.c) ws.A2.c = [];
ws.A2.c.hidden = true;
ws.A2.c.push({a:"SheetJS", t:"This is threaded", T: true});
ws.A2.c.push({a:"JSSheet", t:"This is also threaded", T: true});


XLSX.utils.book_append_sheet(wb, ws, "Sheet2");
XLSX.writeFile(wb, "comments_example.xlsx")
What version of Excel are you using? Also, can you test the attached file? [comments_example.xlsx](https://github.com/SheetJS/sheetjs/files/9475565/comments_example.xlsx) It was generated as follows: ```js var wb = XLSX.utils.book_new(); var ws = XLSX.utils.aoa_to_sheet([["A1"], ["A2"]]); if(!ws.A1.c) ws.A1.c = []; ws.A1.c.push({a:"SheetJS", t:"This comment is visible"}); if(!ws.A2.c) ws.A2.c = []; ws.A2.c.hidden = true; ws.A2.c.push({a:"SheetJS", t:"This comment will be hidden"}); XLSX.utils.book_append_sheet(wb, ws, "Sheet1"); var ws = XLSX.utils.aoa_to_sheet([["A1"], ["A2"]]); if(!ws.A1.c) ws.A1.c = []; ws.A1.c.push({a:"SheetJS", t:"This is not threaded"}); if(!ws.A2.c) ws.A2.c = []; ws.A2.c.hidden = true; ws.A2.c.push({a:"SheetJS", t:"This is threaded", T: true}); ws.A2.c.push({a:"JSSheet", t:"This is also threaded", T: true}); XLSX.utils.book_append_sheet(wb, ws, "Sheet2"); XLSX.writeFile(wb, "comments_example.xlsx") ```
SheetJSDev commented 2022-09-02 07:34:57 +00:00 (Migrated from github.com)

The updated logic is now aligned with how the Pro builds write comments.

SheetJSThreadedComments.xlsx
small example generated using the same example code. That should have visible comments both in Excel 2019 and in older versions of Excel. If the file is showing blank comments or looks corrupted, let us know what version of Excel you are using.

The updated logic is now aligned with how the [Pro](https://sheetjs.com/pro) builds write comments. [SheetJSThreadedComments.xlsx](https://github.com/SheetJS/sheetjs/files/9475857/SheetJSThreadedComments.xlsx) small example generated using the same example code. That should have visible comments both in Excel 2019 and in older versions of Excel. If the file is showing blank comments or looks corrupted, let us know what version of Excel you are using.
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
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: sheetjs/sheetjs#2779
No description provided.