title: VBA Sub not defined for Solver
body: <p>The following line of code is giving me Sub or Function not defined whenever I try to use it. I've tried double checking my spelling, renaming it, looking up other questions online (most other mistakes were forgetting to add an s after sheets or worksheets), but I have no idea what's wrong with my code. I originally got this code from the macro recorder.</p>
  
  <p>I am using this sub multiple times on different sheets, but that hasn't affected my other subs that are similar.</p>
  
  <pre><code>Sub SolverSolver()
  
      SolverOk SetCell:="$G$3", MaxMinVal:=2, ValueOf:=0, ByChange:="$G$4,$G$6", _
          Engine:=1, EngineDesc:="GRG Nonlinear"
      SolverSolve
  
  End Sub
  </code></pre>
  
  <p>Maybe the way in which it's being used is what's wrong, so I've added the way in which its called below. This line is in a large sub of simple commands like giving a cell a name, and this large simple sub also repeats multiple times. However even when attempting to run the sub by directly running it though the developer tab, it still has the same error so I don't think its the way the sub is called.</p>
  
  <pre><code>ActiveSheet.Buttons.Add(630.75, 52.5, 74.25, 26.25).OnAction = "SolverSolver"
  </code></pre>
  
  <p>Any help would be greatly appreciated!</p>