Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Solver Error

Status
Not open for further replies.

riddyBammz

Programmer
May 16, 2008
1
US
On a certain spread every time I ran the model or tool containing the solver function (see code). On the first or second run thru, the entire application crashes when I try to edit a cell or when I use the F2. Most of the time this the crash happens on the second usage.

Does anyone have similar issues or know how to resolve this issue.

Code:

Public Sub NPV0()

'screen updating is false
Application.ScreenUpdating = False
'select Pricing Model worksheet
Worksheets(strSHEETNAME_PricingModel).Select

'clear solver constraint
SolverReset
'
'defines a basic solver model
' Target Cell - NPV
' Value of 0
' Change - BreakevenSpread
'
SolverOk SetCell:="$N$3", MaxMinVal:=3, ValueOf:="0", ByChange:="$N$8"
'
'SolverOk SetCell:=Worksheets(strSHEETNAME_PricingModel).Range("NPV").Value, MaxMinVal:=3, ValueOf:="0", _
ByChange:=Worksheets("PricingModel").Range(BreakevenSpread).Value
SolverSolve UserFinish:=True
SolverFinish KeepFinal:=1

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top