Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to sum 2 cells in a straight table

Hello,

I'm trying to sum 2 cells in a straight table and place the value in VAR_SUM variable.

The following macro gives me the error Type mismatch on line st3 = st1 + st2:

Set st = ActiveDocument.GetSheetObject("CH15")

st1 = st.GetCell(1, 4)

st2 = st.GetCell(4, 4)

st3 = st1 + st2

ActiveDocument.Variables("VAR_SUM").SetContent st3.Number, true

How do I do this?

Many thanks!



2 Replies
Miguel_Angel_Baeyens

Hello,

It should be as simple as

st3 = st1.Text + st2.Text


Hope that helps.

Not applicable
Author

Thanks a lot Miguel!