VBA解算器编译错误

时间:2018-02-07 07:35:54

标签: excel vba excel-vba solver

执行此VBA解算器代码时出现编译错误(未定义函数的子代码):

Sub Macro1()
SolverReset
SolverOk SetCell:="$H$6", _
MaxMinVal:=2, _
ValueOf:="0", _
ByChange:="$H$15:$H$20"
SolverAdd CellRef:="$H$15:$H$20", Relation:=4, FormulaText:="integer"
SolverAdd CellRef:="$H$15:$H$20", Relation:=3, FormulaText:="0"
SolverAdd CellRef:="$H$9", Relation:=3, FormulaText:="$I$9"
SolverAdd CellRef:="$H$10", Relation:=3, FormulaText:="$I$10"
SolverAdd CellRef:="$H$24", Relation:=2, FormulaText:="$I$24"
SolverAdd CellRef:="$H$25", Relation:=2, FormulaText:="$I$25"
SolverSolve userFinish:=True
End Sub

我在代码中遗漏了什么吗?

1 个答案:

答案 0 :(得分:0)