Solver: an unexpected internal error occured, ...

  • Thread starter Thread starter Reza
  • Start date Start date
R

Reza

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 ([email protected])

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
 
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
 
Back
Top