Data Row Array Contains Excel Formula Which Isn't Getting Executed


UiPath Academy - RPA Developer Production Ready course - Lesson 7 - Practice 2 - Calculating Loss Invoices.

I’m trying a new stunt there. Instead of using a for each row loop to add up the losses in the excel sheet, I’m trying a “add data row” activity by passing the excel formula “=sum(d2:d27)” in the array in this manner:

totalRowsPlus1 = dt_results.Rows.Count+1
{“Total losses = “,””,"","=SUM(D2:D"+ totalRowsPlus1.ToString+")"}

This is causing the “=SUM(D2:D27)” to be written in the correct cell, but it is not getting executed and the total is not being displayed. Why isn’t the formula being executed if passed from an array?

Bitte help!

Hi @kewakerukeli!

I tried doing what you’re saying and it worked on my end.
Could you upload the excel file generated?

Hi @kewakerukeli,

Excel formula doesn’t work with system integration activity.
You need to use application integration activity to execute your excel formula.


Hi @nerlichman

Try to use write value activity


@AshwinS2 how are you?

Thanks for the reply but I was actually answering the post, not seeking for help myself :sweat_smile:

@sharique.khan I used it and worked just fine, see attached XAML: Main.xaml



Here’s the result I’m getting:

results.xlsx (7.8 KB)


That may just be the case.


Strange. Your’s did execute, but all the SUM results were 0. Could you see if my xaml works on your end? (30.1 KB)

Your’s solution did work:+1:

Hence, the observation is,

  • When i am using system integration activity(Write Range), it is not working.
  • When i am using application integration activity(Write Range), it is working.

@sharique.khan, @nerlichman,

So, it works within an Excel Application Scope Write Range, but not if used outside the scope. Interesting. I wonder why that is. Would that be a bug we should report or is it working as intended?

1 Like


Lesson learnt. Thanks.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.