Link to home
Start Free TrialLog in
Avatar of rekhasri
rekhasri

asked on

Farpoint Spread Formula in VB App

Hi,

I  need to write custom formula for spread in my application, but so far i have tried using only normal formulas even which arent working.

with vaSpread1
       .row = 1
       .col = 1
       .value = 1

       .row = 1
       .col = 2
       .value = 2

       .recalc = true
       .row = 1
       .col = 3
       .formula = "SUM(A1,B1)"
       
end with


But i dont find the value reflected in that cell when i run the code. Plez help.. this is urgent and its driving me nuts..

would have loved to assign lots of points but dont have that many.. so plez bear..

thanks in advance,
RS.
Avatar of Tommy Kinard
Tommy Kinard
Flag of United States of America image

Hi rekhasri,

The below code should help

set vaSpread1 = ActiveWorkbook.Sheets("NameOfWorkSheet")
With vaSpread1
       .Cells(1, 1).Value = 1
       .Cells(1, 2).Value = 2
       .Cells(1, 3).Formula = "=SUM($A$1:$B$1)"
       .Calculate
End With

dragontooth

Avatar of rekhasri
rekhasri

ASKER

Hi dragontooth..

what is ActiveWorkBook? i want to avoid using excel here..

is there any way of simply using formulae in spread?

thanks,
RS.
Sorry misread the question, don't think I will be any help here.

dragontooth

ASKER CERTIFIED SOLUTION
Avatar of rekhasri
rekhasri

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
rekhasri,

Go here to ask for this question to be deleted and your points refunded.

https://www.experts-exchange.com/Community_Support/

dragontooth