Solver Compiler issue

  • Thread starter Thread starter David Wong
  • Start date Start date
D

David Wong

Hi, I'm relatively new to Excel, but I'm trying to create a button to run amacro, that in turn, executes the Solver function. I created an "Optimize" macro, recorded me clicking on the Solver button, changed properties to Name=Optimize, and assigned it to the button. Problem is:

- When I click on the button, a compile error appears: Sub or Function not defined.
- VB highlights SolverOk
- Stretch goal: Adding an unprotect/protect worksheet function in the macroalso

Not sure what I'm missing here. Help is appreciated!
 
Hi, I'm relatively new to Excel, but I'm trying to create a button to runa macro, that in turn, executes the Solver function. I created an "Optimize" macro, recorded me clicking on the Solver button, changed properties toName=Optimize, and assigned it to the button. Problem is:



- When I click on the button, a compile error appears: Sub or Function not defined.

- VB highlights SolverOk

- Stretch goal: Adding an unprotect/protect worksheet function in the macro also



Not sure what I'm missing here. Help is appreciated!

Help, anyone?
 
Hi David,

Am Tue, 11 Sep 2012 14:30:30 -0700 (PDT) schrieb David Wong:
Hi, I'm relatively new to Excel, but I'm trying to create a button to run a macro, that in turn, executes the Solver function. I created an "Optimize" macro, recorded me clicking on the Solver button, changed properties to Name=Optimize, and assigned it to the button. Problem is:

- When I click on the button, a compile error appears: Sub or Function not defined.
- VB highlights SolverOk
- Stretch goal: Adding an unprotect/protect worksheet function in the macro also

in VB editor you have to set reference to SOLVER


Regards
Claus Busch
 
Back
Top