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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

BUILD ( BUG: Alphabetic Characters in Conditional Formatting Formula interpretted as Named Range

Thread ID:





91419 Nov 17,2009 08:53 PM UTC Aug 30,2012 06:38 AM UTC WinForms 2
Tags: XlsIO
Robert Clugston
Asked On November 17, 2009 08:53 PM UTC

I'm experiencing an error when trying to add a conditional formula that checks if the value is an Alphabetic character. Below is a snippet demonstrating this issue:

IConditionalFormats condition = sheet.Range["A1:A20"].ConditionalFormats;
IConditionalFormat condition1 = condition.AddCondition();
condition1.FormatType = ExcelCFType.CellValue;
condition1.Operator = ExcelComparisonOperator.Equal;
condition1.FirstFormula = "\'r\'"; // ERROR HERE
condition1.FontColor = ExcelKnownColors.Red;
condition1.Color = ExcelKnownColors.Red;

The code will compile fine, however when ran the following unhandled exception is thrown:

Syncfusion.XlsIO.Implementation.Exceptions.ParseException was unhandled
Message="r is not valid named range"
at Syncfusion.XlsIO.Implementation.FormulaParser.CreateLocalName(Int32 iRefIndex, String strToken, ParseParameters arguments, Dictionary`2 indexes, Int32 i, ExcelParseFormulaOptions options)
at Syncfusion.XlsIO.Implementation.FormulaParser.CreateNamedRange(String strToken, ParseParameters arguments, Dictionary`2 indexes, Int32 i, ExcelParseFormulaOptions options, Int32 iRefIndex)
at Syncfusion.XlsIO.Implementation.FormulaParser.ParseIdentifier(String identifier, Dictionary`2 indexes, Int32 i, ExcelParseFormulaOptions options, ParseParameters arguments)
at Syncfusion.XlsIO.Implementation.FormulaParser.ParseFirstOperand(Priority priority, Dictionary`2 indexes, Int32 i, ExcelParseFormulaOptions& options, ParseParameters arguments)
at Syncfusion.XlsIO.Implementation.FormulaParser.ParseExpression(Priority priority, Dictionary`2 indexes, Int32 i, ExcelParseFormulaOptions options, ParseParameters arguments)
at Syncfusion.XlsIO.Implementation.FormulaParser.Parse(String formula, Dictionary`2 indexes, Int32 i, ExcelParseFormulaOptions options, ParseParameters arguments)
at Syncfusion.XlsIO.Implementation.FormulaUtil.ParseString(String strFormula, IWorksheet sheet, Dictionary`2 indexes, Int32 i, Dictionary`2 hashWorksheetNames, ExcelParseFormulaOptions options, Int32 iCellRow, Int32 iCellColumn)
at Syncfusion.XlsIO.Implementation.ConditionalFormatImpl.set_FirstFormula(String value)
at Syncfusion.XlsIO.Implementation.ConditionalFormatWrapper.set_FirstFormula(String value)
at ExcelTestApp.Program.Main(String[] args) in C:\temp\ExcelTestApp\ExcelTestApp\ExcelTestApp\Program.cs:line 22
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

I attempted a number of variants for escaping the alphabetic character however nothing was successful.

Attached is a sample solution which demonstrates the issue. A support incident was opened for this (Incident #62049).


Administrator [Syncfusion]
Replied On November 18, 2009 12:02 PM UTC

Hi Robert,

Thank you for using Syncfusion products.
Its possible to use alphabetics and numbers in conditional formula.The conditional formula is only for setting the Range.I have attached the sample program.
Please refer the sample and let us know if you have any questions.


Alphabetical CharConditional_327ff132.zip

Sridhar [Syncfusion]
Replied On August 30, 2012 06:38 AM UTC

Hi Robert,
Please let us know the above sample solved the query reported in this forum and let us know if you require any further assistance on this.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon