You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by alexndr <al...@hotmail.com> on 2011/04/21 10:52:46 UTC

RE: trying to remove some comments from a cell

I'm having a similar problem. I get no stack trace when calling
removeCellComment but the stored Excel file seems to be corrupted (I get an
error saying: 'File error: data may have been lost' when opening the file in
Excel).  

I'm using OSX and JRE 1.6.0_24.

/Alex

--
View this message in context: http://apache-poi.1045710.n5.nabble.com/trying-to-remove-some-comments-from-a-cell-tp3389606p4330339.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


RE: trying to remove some comments from a cell

Posted by yuzhenling <yu...@gmail.com>.
hello,
 i use poi-3.2-FINAL-20081019.jar, has same problem.
  when i upload one excel file, write comment on some cell with this excel
and download,then modify cell content where it have comment ,and now the
comment is not be remove .so try again to upload this excel has been
modified. then : java.lang.NullPointerException
	at
org.apache.poi.hssf.usermodel.HSSFCell.findCellComment(HSSFCell.java:1021)
	at org.apache.poi.hssf.usermodel.HSSFCell.getCellComment(HSSFCell.java:952)
	at com.**.util.xls.ExcelCellClear.clearComments(ExcelCellClear.java:35)

java src:for(Iterator<HSSFCell> cellIt = row.cellIterator();
cellIt.hasNext();){
			HSSFCell cell = cellIt.next();
			if(cell != null ){
				if(cell.getCellComment() != null){
					cell.setCellComment(null);
				}
				
			}
		}

i debug with program, when 'if(cell != null ){'   cell is not null and it go
'if(cell.getCellComment() != null){' but 
at 'if(cell.getCellComment() != null){' throw java.lang.NullPointerException
,so ...could you give me some method to resolve this problem ,thank you very
much . my english is poor ,sorry please never mind
.

--
View this message in context: http://apache-poi.1045710.n5.nabble.com/trying-to-remove-some-comments-from-a-cell-tp3389606p4555846.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


RE: trying to remove some comments from a cell

Posted by Nick Burch <ni...@alfresco.com>.
On Thu, 21 Apr 2011, alexndr wrote:
> I'm having a similar problem. I get no stack trace when calling 
> removeCellComment but the stored Excel file seems to be corrupted (I get 
> an error saying: 'File error: data may have been lost' when opening the 
> file in Excel).

Does it make any difference if you remove the only comment on a sheet, or 
if you remove one comment but leave others? (Trying to figure out where 
the problem might be coming from)

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org