Solver desde excel vB
No me funciona el c贸digo para automatizar un solver desde VB
Sub Solver_Par()
SolverLoad loadArea:=Range("BC11")
SolverReset
obj = Range("Rer_Par").Value
SolverOk SetCell:="$AX$16", MaxMinVal:=3, ValueOf:=obj, ByChange:= _
"$AX$11:$AX$15"
SolverAdd CellRef:="$AX$11:$AX$15", Relation:=4, FormulaText:="integer"
SolverAdd CellRef:="$AX$11:$AX$15", Relation:=3, FormulaText:="0"
SolverAdd CellRef:="$AX$11", Relation:=1, FormulaText:="$AP$11"
SolverAdd CellRef:="$AX$12", Relation:=1, FormulaText:="$AP$12"
SolverAdd CellRef:="$AX$13", Relation:=1, FormulaText:="$AP$13"
SolverAdd CellRef:="$AX$14", Relation:=1, FormulaText:="$AP$14"
SolverAdd CellRef:="$AX$15", Relation:=1, FormulaText:="$AP$15"
SolverOk SetCell:="$AX$16", MaxMinVal:=3, ValueOf:="2", ByChange:= _
"$AX$11:$AX$15"
SolverSolve
End Sub
Sub Solver_Par()
SolverLoad loadArea:=Range("BC11")
SolverReset
obj = Range("Rer_Par").Value
SolverOk SetCell:="$AX$16", MaxMinVal:=3, ValueOf:=obj, ByChange:= _
"$AX$11:$AX$15"
SolverAdd CellRef:="$AX$11:$AX$15", Relation:=4, FormulaText:="integer"
SolverAdd CellRef:="$AX$11:$AX$15", Relation:=3, FormulaText:="0"
SolverAdd CellRef:="$AX$11", Relation:=1, FormulaText:="$AP$11"
SolverAdd CellRef:="$AX$12", Relation:=1, FormulaText:="$AP$12"
SolverAdd CellRef:="$AX$13", Relation:=1, FormulaText:="$AP$13"
SolverAdd CellRef:="$AX$14", Relation:=1, FormulaText:="$AP$14"
SolverAdd CellRef:="$AX$15", Relation:=1, FormulaText:="$AP$15"
SolverOk SetCell:="$AX$16", MaxMinVal:=3, ValueOf:="2", ByChange:= _
"$AX$11:$AX$15"
SolverSolve
End Sub
