LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Report Generation Toolkit -> excel insert formula.vi

Hello,

i'm using LV2015 with report generation toolkit...

 

i have written correctly an xlsx file...now i would insert some formulas in my file and I have tried to use "Excel insert formula" vi.

 

Problem 1 - using the formula COUNTA (=COUNTA(F2:F300)) i got no problem if written directly in excel...passing through labview instead i get #NAME? (i see the formula written correctly if i pass on in with my mouse)...if i refresh the cell (double click) i obtain the correct value. 

 

There is a way to get directly the right value? i have many of this formula 😞

 

Problem 2 - if i use the formula COUNTIF i receive an error dialog (see attachment) and i can't create my xlsx file 😞

 

do you have any idea to solve my problems? 🙂

 

Many thanks to all,

Gianluca

0 Kudos
Message 1 of 6
(3,668 Views)

Works for me in 2012.

Example_VI_BD.png

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 2 of 6
(3,659 Views)

@Gianluca1985 wrote:

Hello,

i'm using LV2015 with report generation toolkit...

 

i have written correctly an xlsx file...now i would insert some formulas in my file and I have tried to use "Excel insert formula" vi.

 

Problem 1 - using the formula COUNTA (=COUNTA(F2:F300)) i got no problem if written directly in excel...passing through labview instead i get #NAME? (i see the formula written correctly if i pass on in with my mouse)...if i refresh the cell (double click) i obtain the correct value. 

 

There is a way to get directly the right value? i have many of this formula 😞

 

Problem 2 - if i use the formula COUNTIF i receive an error dialog (see attachment) and i can't create my xlsx file 😞

 

do you have any idea to solve my problems? 🙂

 

Many thanks to all,

Gianluca


For problem #1, since you seems to be writing the formula after writing data to the xllsx file you need to recalculate the worksheet to update the values, insert the following code after Excel Insert Formula.vi.

 

Excel WS Calculate.png

 

For problem #2 please provide your vi with a typical xlsx file you are using. Are you using named range?

 

Ben64

0 Kudos
Message 3 of 6
(3,655 Views)

I do not have to call the Calculate function if data is already present in the worksheet.  It updates automatically.  In Excel Options -> Formulas -> Workbook Calculation, this is set to Automatic.  This is probably set to manual if you have to call the Calculate function after inserting the formula.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 4 of 6
(3,637 Views)

@aputman wrote:

I do not have to call the Calculate function if data is already present in the worksheet.  It updates automatically.  In Excel Options -> Formulas -> Workbook Calculation, this is set to Automatic.  This is probably set to manual if you have to call the Calculate function after inserting the formula.


I had some aftertoughts about this and it is possible that the calculate is required because the workbook has not been saved yet (I didn't try). We haven't seen the code so we can only guess.

 

Ben64

0 Kudos
Message 5 of 6
(3,631 Views)

Solved...

 

it was just a formula language problem 😞 i use LV in english and excel in ITA 🙂 

0 Kudos
Message 6 of 6
(3,601 Views)