Solver Compiler issue

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!
 
D

David Wong

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?
 
C

Claus Busch

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top