riddyBammz
Programmer
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
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