![]() |
Solver: an unexpected internal error occured, ...
Hello,
I try to use SolverOK in a VBA Sub but when I run the Sub I recieved the message: "Solver: an unexpected internal error occured, or avalable memory was exhausted". I am sure that I son't have memory problem. I used the macro recorder to do the task that I wanted to do but when I run the code generated by the macro recorder still I get the same error message. It is crucial to me, I appreciate any help Thank you Reza ) Copy of macro: Sub Macro1() SolverAdd CellRef:="$L$8", Relation:=2, FormulaText:="$K$8" SolverOk MaxMinVal:=1, ValueOf:="0", ByChange:="$M$8" SolverSolve End Sub |
Solver: an unexpected internal error occured, ...
One common problem with Solver is with references. It doesn't provide good
feedback. I believe you are missing the "SetCell" reference. Just personal preference is to use SolverOk first, then the Constraints. Another personal preference is to drop "ValueOf" in a Maximization problem since "ValueOf" is ignored. Here, A1 is your Target cell. SolverOk SetCell:="A1", MaxMinVal:=1, ByChange:="$M$8" SolverAdd CellRef:="$L$8", Relation:=2, FormulaText:="$K$8" SolverSolve HTH Dana DeLouis "Reza" wrote in message ... Hello, I try to use SolverOK in a VBA Sub but when I run the Sub I recieved the message: "Solver: an unexpected internal error occured, or avalable memory was exhausted". I am sure that I son't have memory problem. I used the macro recorder to do the task that I wanted to do but when I run the code generated by the macro recorder still I get the same error message. It is crucial to me, I appreciate any help Thank you Reza ) Copy of macro: Sub Macro1() SolverAdd CellRef:="$L$8", Relation:=2, FormulaText:="$K$8" SolverOk MaxMinVal:=1, ValueOf:="0", ByChange:="$M$8" SolverSolve End Sub |
All times are GMT +1. The time now is 09:15 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com