View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jon Peltier Jon Peltier is offline
external usenet poster
 
Posts: 6,582
Default XL 2003: Problem running Solver from VBA

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
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Robert Valentine" wrote in message
et...
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