Excel Application Formula in Cell

0

with visual foxpro I do an excel and in two of the cells I apply two formulas. The first one comes out OK, but the second one appears in Excel with # Name?

1 formula: oSheet.Cells (nFila, nCol) .Formula="= H" + as (nFila) + "* C" + as (nFila) - multiply two cells .. OK

2 formula: oSheet.Cells (nFila, nCol) .Formula="= SUM (" J7: J "+ as (nFila-1))"  - what you see from ace (... as is a function of mine to do allt (str (...  - Here in the excel it appears as # Name ?.  - If I go to the formula and I give the validate button, it refreshes well.

What is wrong? do you know why that happens?

Thanks

    
asked by IcuScc 24.06.2018 в 09:27
source

1 answer

1

property .Formula only supports formulas in English. In your case, you would have to put "=SUM("J7:J"+as(nFila-1))"

But there is another property that allows you to put the formulas according to the language you use, it's called Range.FormulaLocal

Try using oSheet.Cells(nFila,nCol).FormulaLocal = "=SUMA("J7:J"+as(nFila-1))" to see if it takes it.

    
answered by 25.06.2018 / 15:20
source