.NET ez 2012-05-10
利用 NPOI 公式指令:
HSSFWorkbook workbook = new HSSFWorkbook(); HSSFSheet sheet = (HSSFSheet)workbook.CreateSheet("工作表名稱"); HSSFRow Row = (HSSFRow)sheet.CreateRow(0); Row.CreateCell(0).CellFormula = "SUM(A1:B1)"; Row.CreateCell(1).CellFormula = "A1-B1"; //更新有公式的欄位 sheet.ForceFormulaRecalculation = true;
標籤: .NET