We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

ParseException

Hi,
I try set Formula.

Listing:

using (ExcelEngine excelEngine = new ExcelEngine())
{
IWorkbook book = null;
IWorksheet sheet = null;
book = excelEngine.Excel.Workbooks.Add();
sheet = book.ActiveSheet;
IRange range;
range = sheet.Range["A1"];
range.Number = 9.0;
range = sheet.Range["A2"];
range.Number = 12.0;
range = sheet.Range["A3"];
range.Number = 12.0;
range = sheet.Range["A4"];
this --> range.Formula = "SUBTOTAL(9;B1:B3)";
}

And get:

Unexpected token.Unexpected token type: Identifier, string value: at position 11. Formula: SUBTOTAL(9;B1:B3), Position: 11


What wrong ?

2 Replies

AR Artur November 7, 2009 07:58 AM UTC

Hmm.. i Write that:

using (ExcelEngine excelEngine = new ExcelEngine())
{
IWorkbook book = null;
IWorksheet sheet = null;
book = excelEngine.Excel.Workbooks.Add();
sheet = book.ActiveSheet;
IRange range;
range = sheet.Range["A1"];
range.Number = 9.0;
range = sheet.Range["A2"];
range.Number = 12.0;
range = sheet.Range["A3"];
range.Number = 12.0;
range = sheet.Range["A4"];
---> range.Formula = "SUBTOTAL(9,B1:B3)";
}



Unexpected token.Unexpected token type: Identifier, string value: B1:B3 at position 12. Formula: SUBTOTAL(9,B1:B3), Position: 17



GM Geetha M Syncfusion Team November 9, 2009 06:45 AM UTC

Hi Artur,

This exception occurs if different regional setting is used other than English. You may need to set separator to workbook before assigning formula depending upon your current UI culture. Please refer to the following KB article which explains the same:

http://www.syncfusion.com/support/kb/1952/

Regards,
Geetha

Loader.
Live Chat Icon For mobile
Up arrow icon