XL97: Unexpected Results Using the SolverAdd FunctionLast reviewed: March 13, 1998Article ID: Q162259 |
The information in this article applies to:
SYMPTOMSIn Microsoft Excel 97, when you execute the SolverAdd function to programmatically add a constraint in your Solver model, the constraint is not added.
CAUSEThis problem may occur if you use R1C1 notation for the "FormulaText" argument of the SolverAdd function. In Microsoft Excel 97, the "FormulaText" argument for SolverAdd will execute successfully only when specified in A1 notation. NOTE: In earlier versions of Microsoft Excel, when you added a constraint to a problem with the Visual Basic function SolverAdd, you were required to specify the right side of the equation (the "FormulaText" argument) in R1C1 notation. If you did not specify the "FormulaText" argument in R1C1 notation, the constraint was not added. This has changed in Microsoft Excel 97 and now the opposite is true.
WORKAROUNDFor example, the following line will not add a constraint to a Solver model in Microsoft Excel 97:
SolverAdd CellRef:=Range("$A$1"), Relation:=1, FormulaText:="R1C2"To correct this problem, change the FormulaText argument to A1 notation, as in the following example:
SolverAdd CellRef:=Range("$A$1"), Relation:=1, FormulaText:="$B$1"C:\MSOffice\Excel\Libary\Solver\.
|
Additional query words: 97 XL97 addin
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |