# SolverFinish 函数SolverFinish Function

SolverFinishKeepFinalReportArrayoutlinereports 值SolverFinish(KeepFinal, ReportArray, OutlineReports)

KeepFinalVariant 类型的可选参数。KeepFinal Optional Variant. 可取值为 1 或 2。Can be either 1 or 2. 如果**KeepFinal** 为1或被省略，则最终的解决方案值将保留在可变单元格中，替换任何以前的值。If KeepFinal is 1 or omitted, the final solution values are kept in the changing cells, replacing any former values. 如果 KeepFinal 值为 2，最终解决方案值遭放弃，并还原原有值。If KeepFinal is 2, the final solution values are discarded, and the former values are restored. ReportArrayVariant 类型的可选参数。ReportArray Optional Variant. Excel 在求解器完成时生成的报表种类：The kind of report that Excel will create when Solver is finished:

• 当使用“单工 LP”或“GRG 非线性求解”方法时，1 会创建一个“解答”报告，2 会创建一个“敏感度”报告，3 会创建一个“限制”报告。When the Simplex LP or GRG Nonlinear Solving method is used, 1 creates an Answer report, 2 creates a Sensitivity report, and 3 creates a Limit report.

• 如果使用的是演进式求解方法，1 表示生成“答案”报表，2 表示生成“总体”报表。When the Evolutionary Solving method is used, 1 creates an Answer report, and 2 creates a Population report.

• 当**SolverSolve** 返回5（规划求解找不到可行的解决方案）时，1将创建一个可行性报告，2会创建一个可行性边界报告。When SolverSolve returns 5 (Solver could not find a feasible solution), 1 creates a Feasibility Report, and 2 creates a Feasibility-Bounds report.

• SolverSolve 返回 7 时（不满足线性条件），1 会创建“线性”报告。When SolverSolve returns 7 (the linearity conditions are not satisfied), 1 creates a Linearity report.

## 示例Example

``````Worksheets("Sheet1").Activate