This topic has not yet been rated - Rate this topic

# SolverGet Function

Office 2007

Returns information about current settings for Solver. The settings are specified in the Solver Parameters and Solver Options dialog boxes.

Before you use this function, you must establish a reference to the Solver add-in. In the Visual Basic Editor, with a module active, click References on the Tools menu, and then select the Solver.xlam check box under Available References. If Solver.xlam does not appear under Available References, click Browse and open Solver.xlam in the \office12\library\Solver subfolder.

SolverGet(TypeNum, SheetName)

TypeNum Returns
1The reference in the Set Target Cell box, or the #N/A error value if Solver has not been used on the active sheet.
2A number corresponding to the Equal To option: 1 represents Max, 2 represents Min, and 3 represents Value Of.
3The value in the Value Of box.
4The reference (as a multiple reference, if necessary) in the By Changing Cells box.
5The number of constraints.
6An array of the left sides of the constraints, in text form.
7An array of numbers corresponding to the relationships between the left and right sides of the constraints: 1 represents <=, 2 represents =, 3 represents >=, 4 represents int, and 5 represents bin.
8An array of the right sides of the constraints, in text form.

The following settings are specified in the Solver Options dialog box.

TypeNum Returns
9The maximum calculation time.
10The maximum number of iterations.
11The precision.
12The integer tolerance value.
13True if the Assume Linear Model check box is selected; False if it is cleared.
14True if the Show Iteration Results check box is selected; False if it is cleared.
15True if the Use Automatic Scaling check box is selected; False if it is cleared.
16A number corresponding to the type of estimates: 1 represents Tangent, and 2 represents Quadratic.
17A number corresponding to the type of derivatives: 1 represents Forward, and 2 represents Central.
18A number corresponding to the type of search: 1 represents Newton, and 2 represents Conjugate.
19The convergence value.
20True if the Assume Non-Negative check box is selected.

## Example

This example displays a message if you have not used Solver on Sheet1.

 ``````Worksheets("Sheet1").Activate state = SolverGet(TypeNum:=1) If IsError(State) Then MsgBox "You have not used Solver on the active sheet" End If``````

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback