IComment.Visible is ignored

Feb 3, 2012 at 10:04 AM

Hello guys
I try to set a comment on a cell, but it is always visible no matter if I set IComment.Visible = false. In NPOI 1.2.3 everything worked as expected but in NPOI 1.2.4 this issue occured. Does anyone know how to handle this issue? Here's a code snippet below. Thanks.

IComment cellComment = patriarch1.CreateCellComment(new HSSFClientAnchor(0, 0, 0, 0, 4, 2, 14, 5)); 
HSSFRichTextString richText = new HSSFRichTextString("Some notes on the cell...");
richText.ApplyFont(commentFont);
cellComment.String = richText;
cell.CellComment = cellComment;
cellComment.Visible = false;   // ignored

Coordinator
Feb 26, 2012 at 10:33 AM

It's a bug in NPOI 1.2.4. We will fix it in next release

May 4, 2012 at 11:00 AM
Edited May 4, 2012 at 12:50 PM

Hello,

so far the only workaround I've found for this is:

- create empty xls template with this macro:

Private Sub Workbook_Open()
Application.DisplayCommentIndicator = xlCommentIndicatorOnly
End Sub

- Use the template instead of new file...

Horrible workaround, since 99,9999% of users don't even know what the word "macro" means. And don't expect them to find the "run macro" button, since someone thought it'd be fun to move the warning around between every office version....... (Then attempt to hide in the same grayish colors as the toolbars.. Well... Nothing we can do about that...)

Coordinator
May 5, 2012 at 7:52 AM

This issue is fixed in the latest release 1.2.5. No workaround is needed since then.

May 5, 2012 at 8:44 AM
tonyqus wrote:

This issue is fixed in the latest release 1.2.5. No workaround is needed since then.

Hello,

works like a charm, thanks :-)