Private Sub AddComment (sheet As XLSheetWriter, address As XLAddress, CommentText As String,w As Int,y As Int)
Dim factory As JavaObject = sheet.Workbook.jWorkbook.RunMethod("getCreationHelper", Null)
Dim cell As PoiCell = sheet.GetCell(address)
Dim anchor As JavaObject = factory.RunMethod("createClientAnchor", Null)
anchor.RunMethod("setCol1", Array(address.Col0Based + 1))
anchor.RunMethod("setCol2", Array(address.Col0Based + 7))
anchor.RunMethod("setRow1", Array(address.Row0Based + 1))
anchor.RunMethod("setRow2", Array(address.Row0Based + 12))
anchor.RunMethod("setDx1", Array(w))
anchor.RunMethod("setDx2", Array(w))
anchor.RunMethod("setDy1", Array(y))
anchor.RunMethod("setDy2", Array(y))
Dim drawing As JavaObject = sheet.PoiSheet.As(JavaObject).RunMethod("createDrawingPatriarch", Null)
Dim comment As JavaObject = drawing.RunMethod("createCellComment", Array(anchor))
'Dim pcidx As Int = sheet.Workbook.jWorkbook.RunMethod("addPicture",Array(by,sheet.workbook.xl))
'comment.RunMethod("setBackgroundImage",Array(pcidx))
comment.RunMethod("setString", Array(factory.RunMethod("createRichTextString", Array(CommentText))))
'rowvalues(rowvalues.Length-2),rowvalues(rowvalues.Length-1)
cell.As(JavaObject).RunMethod("setCellComment", Array(comment))
Dim pcidx As Int = sheet.Workbook.PoiWorkbook.AddImage(File.DirTemp,CommentText)
comment.RunMethod("setBackgroundImage",Array(pcidx))
End Sub