I am new to the whole npoi thing but I want to put some values to specific cells in excel sheet ("exceltest.xls , cell A1,A2 ) and read the answer from cell A3. The problem is the excel doesn't recalculate the formula and send the old value here is the code
string path = "d:/testexcel2.xls";
HSSFWorkbook book = new HSSFWorkbook(new FileStream(@path, FileMode.Open));
ISheet sheet = book.GetSheet("sheet1");
IRow datarow = sheet.GetRow (0);
datarow.GetCell (0).SetCellValue (22222);
datarow.GetCell (1).SetCellValue (3333);
sheet.ForceFormulaRecalculation=true;
ICell res2 = sheet.GetRow (0).GetCell (2);
res=res2.NumericCellValue.ToString();
Debug.Log (res);
How to save the file?