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

Why is the return value from CalculatedValue include the char \" ??

Cell A9  Formula  =IF(C9=1,"MyTest","") 

If C9 = 1 in my C# project, A9 = \"MyTest\".     including \" \", but in Microsoft Excel, no \"\"

If C9 != 1 in my C# project, A9 = \"\".     including \" \", but in Microsoft Excel, no \"\"

The big problem is below:

Cell A2 Formula =IF(C2=1,"2","") 

Cell A3 Formula =IF(C3=1,"3","") 

Cell A4 Formula =IF(C4=1,"4","") 

Cell A1 Formula =SUM(A2:A4)

A1 will got an error message when A2=\"\" or A3=\"\" or A4=\"\".

How to exclude the char " from the CalculatedValue of XlsIO ExcelEngine?

 

Thanks~


2 Replies

SR Sridhar Syncfusion Team September 2, 2013 06:30 AM UTC

Hi Chen,

Thank you for using Syncfusion products.

Please make use of the "UseNoAmpersandQuotes" of CalcEngine property to remove the (") character while calculating formulas with Essential XlsIO.

Code Snippet [C#]:

IWorksheet sheet = workBook.Worksheets[0];
sheet.CalcEngine.UseNoAmpersandQuotes = true;

Please try the above code snippet at your side and let me know if this helps you. If you still face the issue, please get back to us with the simplified issue reproducing sample to proceed further on this.

Thanks,
Sridhar.S



SR Sridhar Syncfusion Team September 2, 2013 11:56 AM UTC

Hi Chen,

Please ignore the previous post.

Please make use of the below code snippet for calculating the formulas at run time, to remove the (") character with Essential XlsIO and let us know if this helps you.

 

Code Snippet [C#]:

IWorksheet sheet = workBook.Worksheets[0];
sheet.EnableSheetCalculations();
sheet.CalcEngine.UseNoAmpersandQuotes = true;

 

If you still face the issue, please get back to us with the simplified issue reproducing sample to proceed further on this.


Thanks,
Sridhar.S


Loader.
Live Chat Icon For mobile
Up arrow icon