Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help with Solver

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!


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Help with Solver

Perhaps the reference to Solver is not initially set. So
run it once and then go to Tools/Macro/VB Editor and then
to the Vb menu item Tools/References. Somehow Solver
needs to be first "woken up" and running it initialy does
this. Save the file then. Look in the references and see
it may say MISSING: Solver, in which case it still needs
to be woken. Hope this helps. Solver Reference should
have a tick box besides it. When you have woken it up and
saved the reference to it it should be right.

Cheers

-----Original Message-----
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!


---
Message posted from http://www.ExcelForum.com/

.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using solver Leog Excel Worksheet Functions 2 August 17th 09 06:47 PM
Using Solver in VBA redbird Excel Worksheet Functions 1 October 28th 08 07:14 PM
Using Solver [email protected] Excel Worksheet Functions 2 March 30th 08 09:37 PM
Interesting Solver problem (Solver encounters an error) MrShorty Excel Discussion (Misc queries) 3 December 22nd 05 10:52 PM
Solver Lynne Kelly via OfficeKB.com Excel Discussion (Misc queries) 1 May 28th 05 01:21 AM


All times are GMT +1. The time now is 04:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"