I am new to VBA and have some problems using Solver in a macro. I assign the macro to the command button in Excel, and they all calculate fine, but an ugly error appears at the end ("Runtime Error 1004, calculating object method _application failed").
Sub serieus1()
'
' serieus1 Macro
'
'
SolverReset
SolverAdd CellRef:="$R$15", Relation:=2, FormulaText:="1"
SolverAdd CellRef:="$L$18", Relation:=2, FormulaText:="$B$3"
SolverOk SetCell:="$L$19", MaxMinVal:=2, ValueOf:=0, ByChange:="$L$15:$Q$15", _
Engine:=1, EngineDesc:="GRG Nonlinear"
SolverSolve
End Sub
source
share