- Code: Select all
var wbk = new Spire.Xls.Workbook();
try
{
wbk.LoadFromFile(InputFileName);
wbk.CalculateAllValue();
wbk.CalculationMode = Spire.Xls.ExcelCalculationMode.Manual;
wbk.SaveToFile("SPIRE."+OutFileName);
MessageBox.Show("Well done");
}
catch (Exception e)
{
MessageBox.Show("ERROR: " + e.ToString());
}
Got the exception:
Unexpected token.Unexpected token type: tInteger, string value: at position 34. Formula: COUNTIFS(Enterprises!$A$6:$A$3098,2,Enterprises!$H$6:$H$3098,BI$4,Enterprises!$B$6:$B$3098,$B12,Enterprises!$G$6:$G$3098,$C12)+SUMIFS(Enterprises!$M$6:$M$3098,Enterprises!$A$6:$A$3098,4,Enterprises!$H$6:$H$3098,BI$4,Enterprises!$B$6:$B$3098,$B12,Enterprises!$G$6:$G$3098,$C12)+SUMIFS(Enterprises!$M$6:$M$3098,Enterprises!$A$6:$A$3098,5,Enterprises!$H$6:$H$3098,BI$4,Enterprises!$B$6:$B$3098,$B12), Position: 34
Confused by commas instead of semicolons in formula... Input xlsx-file is OK, because it was just saved by MS Excel 2010.
Can provide test xlsx-file by request.
Thank you.