ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Solver Compiler issue (https://www.excelbanter.com/excel-worksheet-functions/447098-solver-compiler-issue.html)

David Wong

Solver Compiler issue
 
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

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

David Wong

Solver Compiler issue
 
On Tuesday, September 11, 2012 2:30:30 PM UTC-7, David Wong wrote:
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



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


Help, anyone?

Claus Busch

Solver Compiler issue
 
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
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2


All times are GMT +1. The time now is 04:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com