Try this:
activecell.formula="=SUM(RC[-5]*RC[-3])"
instead of
ActiveCell.FormulaR1C1 = "=RC[-5]*RC[-3]"
remove the R1C1 from the reference side, and add a SUM() around the cell references. The R1C1 references never worked for me, but "formula" did. Also, for some reason I always have to have the sum() part in there even if I was dividing. Go figure.
I perform the identical thing in my program. I'm using VFP5SP3 with Office2000.
If you'd like the whole code, let me know, and I'll email it to you. You can contact me at Stephen.T.Rushton@lmco.com.
Good luck, Stephen.
>I have sent 2500 rows to excel, the sheet is open and I want to create an extended cost in column 'O'
>
>I create the var lcLocation to reference the cell letter & #. When I pass it to Excell I get a C000000000005 error in VFP, and yes I have SP#3 installed.
>
> oleApp=getobject(,"Excel.Application")
>for i = 1 to reccount('inv2')
>lclocation = '"O'+alltrim(str(i+1))+'"'
>
>Range(lclocation).Select
> ActiveCell.FormulaR1C1 = "=RC[-5]*RC[-3]"
>
>endfor
>
> oleApp.Application.visible=.t.
>
>
>the code from excel macro looked like this:
> Range("O2").Select
> ActiveCell.FormulaR1C1 = "=RC[-5]*RC[-3]"
> Range("O3").Select
>End Sub
>
>TIA