我使用以下代码添加评论:
ws.Cell("A5").Comment.SetVisible().AddText("sample");
ws.PageSetup.SetShowComments(XLShowCommentsValues.AsDisplayed);
当我注释掉以下代码时,它会将图像添加到Excel文档中,然后注释就可以了。但是如果取消注释此代码,则会出现以下错误:
XLPicture pic = new XLPicture
{
NoChangeAspect = true,
NoMove = true,
NoResize = true,
ImageStream = memo,
Name = "Export Image",
PaddingX = 12,
PaddingY = 18
};
XLMarker fMark = new XLMarker { ColumnId = 1, RowId = 1 };
pic.AddMarker(fMark);
workSheet.AddPicture(pic);