An error occurred in Macro`s error in VB

Asked By 30 points N/A Posted on -


If I try to run this macro, I will get a compile error. The command SolverResetis will get highlighted, and the error message appears.

Macro`s error in VB

Microsoft Visual Basic

Compile error:

Sub or Function not defined

         OK               Help

Best Answer by Wwilliam George
Answered By 0 points N/A #199005

An error occurred in Macro`s error in VB



A Sub or Function must be defined in order to be called. Causes of error:
1) Misspelling the name.
2) Call a procedure from another project without adding a reference(in the References dialog box).
3) Specifying a procedure, not visible to the calling procedure.
4) Declaring a Windows dynamic-link library (DLL) routine, that is not in the specified library or code resource.
To correct this error, you may try this:
1) Make sure that the procedure spelling is correct.
2) Check the procedure name in the References dialog box. If it does not appear, click the Browse button to search for it.
Best Answer
Best Answer
Answered By 0 points N/A #137052

An error occurred in Macro`s error in VB




The attached picture states that SolverOK but SolverReset highlighted when you tried to run Macro. To resolve this issue try to set reference to SOLVER. How to do it? Here’s how…

1.       Open your workbook. Find TOOLS Menu click Macro then choose Visual Basic Editor (VBE)

2.       With Visual Basic Editor, choose Menu Tools.

3.       Find and click References. Check on the Solver References

4.       Select Solver.xls and then click OK

If there is no Solver.xls in Available References list, look for it.

1.       Click Browse.

2.       Find dialogue box Add Reference

3.       Find and select Solver.xla file. Open.

4.       Typical path of Solver.xla (C:Program FilesMicrosoft OfficeOfficeLibrarySolver subfolder)

Don’t forget to tick the Solver Box in the VBA References List to ensure display in the VBA Project Explorer window. Also take note that you tick the STOP button before going into tools and references.

Login/Register to Answer

Related Questions