XL 2003: Problem running Solver from VBA

R

Robert Valentine

Group:

I get the following error message when I try to run Solver from VBA code:

"Solver: An unexpected internal error occurred, or available memory was
exhausted."

I am running Excel 2003 SP2 and Windows XP Professional on a network
installation.

Here is the simple code that I am trying to run:

Sub SolveEquation()
Application.Run "Solver.xla!Auto_Open"
SolverReset
SolverOk MaxMinVal:=1, ValueOf:="0", ByChange:="$D$7:$D$8"
SolverAdd CellRef:="$A$7:$A$8", Relation:=2, FormulaText:="$B$7:$B$8"
SolverSolve userFinish:=True
End Sub

The error occurrs on the third line of the code that begins with "SolverOk
MaxMinVal:=1..."

Any help would be greatly appreciated. (I called Microsoft after viewing
their KB article regarding the problem in Excel 2000, but they were of no
help at all. I guess they have no fix for this in Excel 2003.)

Thanks,
Bob V
 
J

Jon Peltier

Just a thought, and I don't know if it will help, but did you try reversing
the order of the SolverAdd and SolverOk commands?

- Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top