Professional Documents
Culture Documents
Article • 09/13/2021
Returns information about current settings for Solver. The settings are specified in the Solver Parameters and Solver
Options dialog boxes.
Note The Solver add-in is not enabled by default. Before you can use this function, you must have the Solver add-in
enabled and installed. For information about how to do that, see Using the Solver VBA Functions. After the Solver add-in is
installed, 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 Solver under Available References. If Solver does not appear under
Available References, click Browse, and then open Solver.xlam in the \Program Files\Microsoft
Office\Office14\Library\SOLVER subfolder.
SolverGet(TypeNum, SheetName)
TypeNum Required Integer. A number specifying the type of information you want. The following settings are specified in
the Solver Parameters dialog box.
ノ Expand table
TypeNum Returns
1 The reference in the Set Target Cell box, or the #N/A error value if Solver has not been used on the active sheet.
2 A number corresponding to the Equal To option: 1 represents Max, 2 represents Min, and 3 represents Value Of.
4 The reference (as a multiple reference, if necessary) in the By Changing Cells box.
7 An 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.
13 True if the Simple LP Solving method is selected; False if another Solving method is selected.
20 True if the Make Unconstrained Variables Non-Negative check box is selected; False if it is cleared.
The following settings are specified in the Solver Options dialog box.
ノ Expand table
TypeNum Returns
14 True if the Show Iteration Results check box is selected; False if it is cleared.
TypeNum Returns
15 True if the Use Automatic Scaling check box is selected; False if it is cleared (All Methods tab).
16 A number corresponding to the type of estimates: 1 represents Tangent, and 2 represents Quadratic.
17 A number corresponding to the Derivatives option in the GRG Nonlinear tab: 1 represents Forward, and 2 represents Central
(GRG Nonlinear tab).
18 A number corresponding to the type of search: 1 represents Newton, and 2 represents Conjugate.
21 The Population Size option (GRG Nonlinear tab and Evolutionary tab).
23 True if the Use Multistart check box is selected; False if it is cleared (GRG Nonlinear tab).
24 True if the Require Bounds on Variables check box is selected; False if it is cleared (GRG Nonlinear tab and Evolutionary tab).
SheetName Optional Variant. The name of the sheet that contains the Solver model for which you want information. If
SheetName is omitted, this sheet is assumed to be the active sheet.
Example
This example displays a message if you have not used Solver on Sheet1.
VB
Worksheets("Sheet1").Activate
state = SolverGet(TypeNum:=1)
If IsError(State) Then
MsgBox "You have not used Solver on the active sheet"
End If
Feedback
Was this page helpful? Yes No