Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Wed Aug 05, 2020 12:24 pm

I want to write this formula in an Excel Cell:
Code: Select all
sheet.Range["H5"].Formula = "=WENN(ABS(F5)>1;\"Nicht Ok\";\"Ok\")";

but the Output in Excel looks like this:
Code: Select all
=WENN(ABS(F5)>'1;"NICHT OK";"OK"')


Due to the ' sign the formula doesn't work

lukas8lob
 
Posts: 2
Joined: Wed Aug 05, 2020 12:21 pm

Wed Aug 05, 2020 12:26 pm

lukas8lob wrote:I want to write this formula in an Excel Cell:
Code: Select all
sheet.Range["H5"].Formula = "=WENN(ABS(F5)>1;\"Nicht Ok\";\"Ok\")";

but the Output in Excel looks like this:
Code: Select all
=WENN(ABS(F5)>'1;"NICHT OK";"OK"')


Due to the ' sign the formula doesn't work


I tried it with .Text aswell, still doesn't work

lukas8lob
 
Posts: 2
Joined: Wed Aug 05, 2020 12:21 pm

Thu Aug 06, 2020 10:14 am

Hello,

Thanks for your inquiry.
I tested your code with the latest Spire.XLS Pack(Hotfix) Version:10.7.2 but got the error message "Unexpected token.Unexpected token type: Identifier, string value: at position 15. Formula: WENN(ABS(F5)>1;"Nicht Ok";"Ok"), Position: 15".
To help us further investigate your issue, please provide your full code, your OS information (E.g. Windows 7, 64 bit) and region setting (E.g. China, Chinese). Thanks in advance.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Fri Aug 14, 2020 1:42 am

Hello,

Hope you are doing well.
How is your issue now? Could you please give us some feedback at your convenience?
Thanks in advance.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Return to Spire.XLS