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?
--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03
----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------
"Bill Allen" <[email protected]> wrote in message
news:wDPKd.4227$G31.2529@okepread05...
> Oops. Sent to the wrong group.
>
> Sorry.
>
> "Bill Allen" <[email protected]> wrote in message
> news:8BPKd.4225$G31.2964@okepread05...
> > 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
> >
> >
> >
>
>
Bookmarks