Running Solver Silently and Handling Its Responses with VBA

UserFinish:=True option runs solver silently. You can assign SolverSolve to a variable:

solverResponse = SolverSolve(UserFinish:=True)

Then evaluate the “answer”:

Select Case solverResponse
    Case 0
        MsgBox ("Solver found a solution. All constraints and optimality conditions are satisfied.")
    Case 1
        MsgBox ("Solver has converged to the current solution. All constraints are satisfied")
    Case 2
        MsgBox ("Solver cannot improve the current solution. All constraints are satisfied.")
    Case 3
        MsgBox ("Stop chosen when the maximum iteration limit was reached.")
    Case 4
        MsgBox ("The Set Cell values do not converge.")
    Case 5
        MsgBox ("Solver could not find a feasible solution.")
    Case 6
        MsgBox ("Solver stopped at user's request.")
    Case 7
        MsgBox ("The conditions for Assume Linear Model are not satisfied.")
    Case 8
        MsgBox ("The problem is too large for Solver to handle.")
    Case 9
        MsgBox ("Solver encountered an error value in a target or constraint cell.")
    Case 10
        MsgBox ("Stop chosen when maximum time limit was reached.")
    Case 11
        MsgBox ("There is not enough memory available to solve the problem.")
    Case 12
        MsgBox ("Another Excel instance is using SOLVER.DLL. Try again later.")
    Case 13
        MsgBox ("Error in model. Please verify that all cells and constraints are valid.")
    Case 14
        MsgBox ("Solver found an integer solution within tolerance. All constraints are satisfied.")
    Case 15
        MsgBox ("Stop chosen when the maximum number of feasible [integer] solutions was reached.")
    Case 16
        MsgBox ("Stop chosen when the maximum number of feasible [integer] subproblems was reached.")
    Case 17
        MsgBox ("Solver converged in probability to a global solution.")
    Case 18
        MsgBox ("All variables must have both upper and lower bounds.")
    Case 19
        MsgBox ("Variable bounds conflict in binary or all different constraint.")
    Case 20
        MsgBox ("Lower and upper bounds on variables allow no feasible solution.")
    Case Else
        MsgBox ("Solver returned an unknown result")
    End Select
End Sub

Source