我對整個npoi事物很陌生,但我想在excel表格(「exceltest.xls,單元格A1,A2)中放入一些特定單元格的值並從單元格A3中讀取答案。問題是,Excel不重新計算公式,並送來舊值是代碼在Unity中使用NPOI
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);
如何保存文件?
這和'unity3d'有關嗎? – MickyD
我正在統一程序,所有的值將被輸入在輸入欄 –