XlsRange.IsFormulaHidden属性用于确定工作表受保护时是否隐藏公式。 您可以通过将XlsRange.IsFormulaHidden属性设置为true来隐藏特定单元格区域中的公式,但请注意只有在工作表受保护时才能隐藏公式,如果在工作表处于工作表保护状态时它们不会被隐藏。
//Initialize an object of Workbook classWorkbook workbook = new Workbook();//Load the Excel fileworkbook.LoadFromFile("Input.xlsx");//Get the first worksheetWorksheet sheet = workbook.Worksheets[0];//Hide the formulas in the used rangesheet.AllocatedRange.IsFormulaHidden = true;//Protect the worksheet with passwordsheet.Protect("123");//Save the fileworkbook.SaveToFile("HideFormulas.xlsx", ExcelVersion.Version2013);
截图:

控件
标签:文档管理Excel文档处理
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!