XL 2003: Problem running Solver from VBA


Robert Valentine


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

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

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

Sub SolveEquation()
Application.Run "Solver.xla!Auto_Open"
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

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.)

Bob V

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