I tried below code for sum, that works but this always calculate from R2 till last line
so what number of rows do you want to sum?

objXLSheet.range(strRange).FormulaR1C1 = "=SUM(" & TempString & ":R[-1]C)"
what value has tempstring? should be something like "R" & startrow & "C"