ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Solver marco still prompts to keep solution (https://www.excelbanter.com/excel-programming/433645-solver-marco-still-prompts-keep-solution.html)

Greg Snidow

Solver marco still prompts to keep solution
 
Greetings. I was able to record a macro for solver, and it works like a
charm. However, even though I did not stop recording until after I chose
"keep solver solution", and then hit ok, the dialog box asking me if I want
to keep the solution still pops up. Any ideas on how to get it to
automaticall keep the solution if one is found? Below is the macro.

Thank you

Greg

SolverReset
SolverOk SetCell:="$N$7", MaxMinVal:=2, ValueOf:="0",
ByChange:="$B$8:$M$8"
SolverAdd CellRef:="$N$3:$N$7", Relation:=1, FormulaText:="$P$3:$P$7"
SolverAdd CellRef:="$N$8", Relation:=2, FormulaText:="$P$8"
SolverOk SetCell:="$N$7", MaxMinVal:=2, ValueOf:="0",
ByChange:="$B$8:$M$8"
SolverOptions MaxTime:=100, Iterations:=100, Precision:=0.000001,
AssumeLinear _
:=True, StepThru:=False, Estimates:=1, Derivatives:=1,
SearchOption:=1, _
IntTolerance:=5, Scaling:=False, Convergence:=0.0001,
AssumeNonNeg:=True
SolverOk SetCell:="$N$7", MaxMinVal:=2, ValueOf:="0",
ByChange:="$B$8:$M$8"
SolverSolve

Greg Snidow

Solver marco still prompts to keep solution
 
Ok, found my answer here right after I posted.

SolverSolve userfinish:=True



"Greg Snidow" wrote:

Greetings. I was able to record a macro for solver, and it works like a
charm. However, even though I did not stop recording until after I chose
"keep solver solution", and then hit ok, the dialog box asking me if I want
to keep the solution still pops up. Any ideas on how to get it to
automaticall keep the solution if one is found? Below is the macro.

Thank you

Greg

SolverReset
SolverOk SetCell:="$N$7", MaxMinVal:=2, ValueOf:="0",
ByChange:="$B$8:$M$8"
SolverAdd CellRef:="$N$3:$N$7", Relation:=1, FormulaText:="$P$3:$P$7"
SolverAdd CellRef:="$N$8", Relation:=2, FormulaText:="$P$8"
SolverOk SetCell:="$N$7", MaxMinVal:=2, ValueOf:="0",
ByChange:="$B$8:$M$8"
SolverOptions MaxTime:=100, Iterations:=100, Precision:=0.000001,
AssumeLinear _
:=True, StepThru:=False, Estimates:=1, Derivatives:=1,
SearchOption:=1, _
IntTolerance:=5, Scaling:=False, Convergence:=0.0001,
AssumeNonNeg:=True
SolverOk SetCell:="$N$7", MaxMinVal:=2, ValueOf:="0",
ByChange:="$B$8:$M$8"
SolverSolve



All times are GMT +1. The time now is 07:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com