> Hi all, Using xl 2004 v.11.3.5 - Mac OS 10.4.10
> I am trying to run solver from a macro but not having much luck.
> If I select solver from the menu and input the right info and click solve
> It works fine. When I run solver via a macro I get a compile error - Sub or
> Function not defined.Below is where I"m at. Any pointers to my mistake
> please.
XL doesn't have any idea what "SolverOK" means, because it isn't a
built-in function. You need to set a reference to the Solver Add-in.
One way:
In XL, Choose Tools/Solver... Click Close.
In the Visual Basic Editor, click Reset. Choose Tools/References. In the
dialog that opens, check the Checkbox next to Solver. Click OK and save
your workbook.
Now when you open your workbook, XL will load Solver.xla as well, and
your code will compile fine.
As an alternative, you can put an alias from Solver.xla (found in
HD:Applications:Microsoft Office 2004:Office:Add-Ins
into your startup folder (by default
HD:Applications:Microsoft Office 2004:Office:Startup:Excel
but you can specify a different folder in Preferences/General). Then
Solver.xla will open every time you open XL and its functions will
always be available for you to set a reference to.
Skin Paul - 13 Sep 2007 03:32 GMT
Thanks J.E. You came through once again. Paul
On 13/9/07 3:08 AM, in article
jemcgimpsey-86F89A.11081812092007@msnews.microsoft.com, "JE McGimpsey"
<jemcgimpsey@mvps.org> wrote:
>> Hi all, Using xl 2004 v.11.3.5 - Mac OS 10.4.10
>> I am trying to run solver from a macro but not having much luck.
[quoted text clipped - 28 lines]
> Solver.xla will open every time you open XL and its functions will
> always be available for you to set a reference to.