详细步骤:
Step 1:实例化一个Workbook实例并加载excel文档
Workbook workbook = new Workbook();workbook.LoadFromFile("Comments.xlsx");
Step 2:获取第一个工作表
Worksheet sheet = workbook.Worksheets[0];
Step 3:隐藏或显示工作表中的具体注释
//Hide commentsheet.Comments[0].IsVisible = false;//Show comment//sheet.Comments[0].IsVisible = true;
Step 4:保存文档
workbook.SaveToFile("HideComment.xlsx", ExcelVersion.Version2013);
截图:

完整代码:
//Instantiate a Workbook instance and load the excel documentWorkbook workbook = new Workbook();workbook.LoadFromFile("Comments.xlsx");//Get the first worksheetWorksheet sheet = workbook.Worksheets[0];//Hide the specific comment in the worksheetsheet.Comments[0].IsVisible = false;//Show the specific comment in the worksheet//sheet.Comments[0].IsVisible = true;//Save the documentworkbook.SaveToFile("HideComment.xlsx", ExcelVersion.Version2013);
Spire.XLS
标签:Excel
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!