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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel 2000 Solver: An unexpected internal error occurred

Status
Not open for further replies.

SteveGregory

Technical User
Oct 5, 2007
2
US
An unexpected internal error occurred, or available memory was exhausted."

I've tried a hotfix download from Microsoft. I've tried the 'Application.Run "Solver.xla!MenuUpdate"', the 'Application.Run "Solver.xla!Auto_Open"'. Then, I tried only loading the parameters that I really needed and the VBA code worked.

Sub Maximum_Moment()
SolverLoad loadArea:=Range("OPT")
SolverOptions Iterations:=200
SolverSolve UserFinish:=True
End Sub

The "OPT" range
=MAX($SOLUTION)
=COUNT($VARIABLE)
=$VARIABLE<'=L
=$VARIABLE>'=0

Then, I made a new VBA macro and kept getting the error with manual Solver runs and using the macro code. Here is the code:
Sub Wheel_Loading()
SolverLoad loadArea:=Range("Wheel")
SolverOptions Iterations:=200
SolverSolve UserFinish:=True
End Sub

another version...?
Sub Wheel_Loading()
SolverReset
SolverOk SetCell:="M", MaxMinVal:=1, ByChange:="P1X"
SolverAdd CellRef:="P2X", Relation:=1, FormulaText:="c3"
SolverAdd CellRef:="P1X", Relation:=1, FormulaText:="L"
SolverAdd CellRef:="P1X", Relation:=3, FormulaText:="0"
SolverOptions Iterations:=200, Convergence:=0.00001
SolverSolve UserFinish:=True
End Sub

The "Wheel" range
=MAX($M)
=COUNT($P1X)
=$P1X>'=0
=$P2X<'=L
Any ideas???
 
I tried changing my second version of the macro to find out what instruction was causing Solver to choke. The error occurs when setting the ByChange cell P1X. New VBA macro:

Sub Model()
SolverReset
SolverOk SetCell:="M"
SolverOk MaxMinVal:=1
SolverOk ByChange:="P1X"
SolverAdd CellRef:="P2X", Relation:=1, FormulaText:="c3"
SolverAdd CellRef:="P1X", Relation:=1, FormulaText:="L"
SolverAdd CellRef:="P1X", Relation:=3, FormulaText:="0"
SolverOptions Iterations:=200, Convergence:=0.00001
SolverSolve UserFinish:=True
End Sub

I am still clueless ???
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top