W
witrias
I am creating a spreadsheet for a client that uses the Solver Add-In to
calculate an optimal price.
To make the spreadsheet a bit more usable, I added a VB CmmandButton to
the worksheet to allow a user to Solve for the optimal price without
having to re-enter the variables and without having to interpret the
Solver UI.
Here is my logic:
Call Application.Run("SolverReset")
Call Application.Run("SolverAdd", "A", 1, "B")
Call Application.Run("SolverOk", "B2", 1, 0, "B2")
Call Application.Run("Solver.xla!SolverSolve", False, False)
Here's my dillema:
When I open the file for the first time and click the button, I get an
error message saying "Run-time error 1004. The macro "SolverReset" can
not be found.
However if I execute the Solver manually (Tools...Solver) once time,
the push button subsequently works perfectly. Its as if the solver
isn't fully loaded and the macro can't be read when the file is first
opened.
Any thoughts? Thanks in advance for the help!
calculate an optimal price.
To make the spreadsheet a bit more usable, I added a VB CmmandButton to
the worksheet to allow a user to Solve for the optimal price without
having to re-enter the variables and without having to interpret the
Solver UI.
Here is my logic:
Call Application.Run("SolverReset")
Call Application.Run("SolverAdd", "A", 1, "B")
Call Application.Run("SolverOk", "B2", 1, 0, "B2")
Call Application.Run("Solver.xla!SolverSolve", False, False)
Here's my dillema:
When I open the file for the first time and click the button, I get an
error message saying "Run-time error 1004. The macro "SolverReset" can
not be found.
However if I execute the Solver manually (Tools...Solver) once time,
the push button subsequently works perfectly. Its as if the solver
isn't fully loaded and the macro can't be read when the file is first
opened.
Any thoughts? Thanks in advance for the help!