Can't find "Solver"

  • Thread starter Thread starter Bill Allen
  • Start date Start date
B

Bill Allen

I'm writing one of my first macros and I would appreciate some help.

I am trying to automate the Solver add-in. I started by using the macro
recorder which generated the following:

Sub SolveForK()
'
' SolveForK Macro
' Macro recorded 1/29/2005 by Bill Allen, S.E.
'
' Keyboard Shortcut: Ctrl+Shift+K
'
SolverOk SetCell:="$R$5", MaxMinVal:=3, ValueOf:="0", ByChange:="$Q$5"
SolverSolve
End Sub

Question 1:
When I try to execute the code, I get the following error:

With the "SolverOk" highlighted, the error reads:
---------------------------
Microsoft Visual Basic
---------------------------
Compile error:

Sub or Function not defined
---------------------------
OK Help
---------------------------

What is wrong with the code? What do I need to fix?

Thanks,

Bill
 
Not necessarily - This one is a bit of a catchall. Take a look in the VBA
help files for solver and notice the bit that says

Before you use this function, you must establish a reference to the Solver
add-in. With a Visual Basic module active, click References on the Tools
menu, and then select the Solver.xla check box under Available References.
If Solver.xla doesn't appear under Available References, click Browse and
open Solver.xla in the \Office\Library\Solver\ subfolder.

Does that help?
 
Ken -

That helps a lot. As you may have suspected, the check box was unchecked.

This concept will help when I don't have a code workaround.

I hope I remember with that time comes :o).

Regards,

Bill Allen
 
Back
Top