Skip to content

SolvProblem

Michael Waite edited this page Mar 15, 2026 · 2 revisions

The main class to define the Solver problem, including Objective, Decision Variables, and Constraints. Example usage:

Dim problem as SolvProblem
Dim ws as Worksheet
Set ws = ActiveWorkbook.Worksheets("my worksheet")
Set Problem = New SolvProblem
Problem.Initialize ws
Class Method/Property Description
SolvProblem AfterSolve Fires on each solution trial iteration to allow user to perform intermediate processing.
SolvProblem BeforeSolve Fires on each solution trial iteration to allow user to perform intermediate processing.
SolvProblem CleanUp Cleans the problem worksheet of all solver associated info.
SolvProblem Constraints Exposes the Constraints object.
SolvProblem DecisionVars Exposes the DecisionVars object.
SolvProblem Initialize Initializes the problem - this must be called before all other methods.
SolvProblem Objective Exposes the Objective object.
SolvProblem Reset Resets the problem objective and decision variables without affecting the solver options.
SolvProblem SaveSolutionsToArray Returns a Variant array containing all intermediate (trial) and final solutions, as well as a flag indicating whether each solution passed all problem contraints.
SolvProblem SaveSolutionsToRange Saves all intermediate and final solutions to the given Worksheet Range.
SolvProblem ShowTrial Fires on each solution trial iteration to allow user to perform intermediate processing.
SolvProblem SolveIt Solves the currently defined problem. Returns the Solver result code.
SolvProblem Solver Exposes the Solver object.
SolvProblem SolverSheet Returns a reference to the current problem Worksheet

Clone this wiki locally