Microsoft KB Archive/171750

= XL97: Compile Error Running Recorded Macro That Uses Solver =

Article ID: 171750

Article Last Modified on 10/10/2006

-

APPLIES TO


 * Microsoft Excel 97 Standard Edition

-



This article was previously published under Q171750





SYMPTOMS
When you run a Visual Basic for Applications macro that you created by using the macro recorder, you may receive the following error message:

Compile error:

Sub or Function not defined



CAUSE
The problem occurs when you run a recorded a macro that uses the Solver add- in and you do not reference the Solver add-in.



RESOLUTION
To resolve the problem, create a reference to the Solver add-in. To create a reference to the Solver add-in, follow these steps:


 * 1) Start the Visual Basic Editor (press ALT+F11).
 * 2) On the Tools menu, click References.
 * 3) Select Solver.xla, and then click OK.

NOTE: The Solver.xla file is located in C:\Program Files\Microsoft Office\Office\Library\Solver.

The next time you run the macro, this problem does not occur.



STATUS
This behavior is by design of Microsoft Excel.

