title: VBA: Runtime error 1004 using Solver
body: <p>I'm new to VBA, and have some trouble with using the Solver in a macro. I'm assigning a macro to a command button in Excel, and they calculate everything perfectly, but an ugly error shows up as well at the end ("Runtime error 1004, method calculation of object _application failed").  </p>
  
  <pre><code>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
  </code></pre>