View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default VBA Code Reference to Solver Failure !

Here is a reference that you might find helpful:

http://support.microsoft.com/default...b;en-us;843304
How to create Visual Basic macros by using Excel Solver in Excel 97

--
Regards,
Tom Ogilvy


"monir" wrote:

Hello;

Could someone please advise on how to check in a VBA macro if Solver has
encountered a problem and could not find a solution ??

Basically, after loading and calling Solver, I would like to make sure that
a solution has been found by Solver before continuing with the computations.
--------------------------------------------------------
SolverOk SetCell:="$E$54", MaxMinVal:=1, ValueOf:="0", ByChange:= _
"$B$49,$F$54,$G$54"
'....your statement .....
--------------------------------------------------------

And, if Solver is run manually from the Tool menu, is "Sover could not find
a feasible solution" a run-time error ??

Thank you kindly.