View Full Version : Solved: Issue with running Solver in VBA

04-24-2007, 07:52 AM
I am writing a macro that uses the Solver add in in Excel.

I can get the Solver to work fine, although once it has run I get an 'Solver Results Box', where you can choose to keep the results from the Solver or restore original values.

I can't work out how I can automate the response to this to click OK each time this box appears to save doing it for every record.

The code I have already to run the Solver is:

SolverOk SetCell:="$I$13", MaxMinVal:=3, ValueOf:="0", ByChange:="$I$6"

Any help would be appreciated!


04-27-2007, 09:33 AM
From Excel VBA help file:

SolverSolve(UserFinish, ShowRef)

UserFinish Optional Variant. True to return the results without displaying the Solver Results dialog box. False or omitted to return the results and display the Solver Results dialog box.