LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Error with ExcelRpt_SetCellRangeAttribute for ER_CR_ATTR_FORMULA

Hi

 

Using CVI 8.5

 

My application needs to write an excel file.

 

some test code :

 

            __caErrChk (ExcelRpt_SetCellValue(SheetMoteur, "A1", CAVT_INT, 30));
            __caErrChk (ExcelRpt_SetCellRangeAttribute(SheetMoteur, "A2", ER_CR_ATTR_FORMULA, "=SI(A1=30;0;1)"));

 

The first line is OK, and 30 is written in A1.

The second line always fails.

'SI' if the french version of 'IF'

 

if I write directly the formula "=SI(A1=30;0;1)" under excel in A2, it works fine...

 

            __caErrChk (ExcelRpt_SetCellRangeAttribute(SheetMoteur, "A2", ER_CR_ATTR_FORMULA, "=A1"));

 

the formula "=A1" works fine.

 

 

Thanks

0 Kudos
Message 1 of 3
(4,706 Views)

The help documentation in Excel indicates that you have to separate the function arguments with commas, not semicolons.  Check that you are using the correct separator in your function call.

0 Kudos
Message 2 of 3
(4,675 Views)

Hi.

 

Thanks , you right.

With comma, it works fine.

 

What is strange is that the comma are transformed into semicolons in excel.

 

Must be related to the language. My excel is in french and when I enter a formula directly I must use semicolons.

But to write formula from labwindows, it appears I need to write commas that are traduced into semicolons by excel...

 

Regards

 

 

Chris

 

0 Kudos
Message 3 of 3
(4,664 Views)