Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I recorded a Macro in Excel 2007 that uses the Solver, so I have macros
enabled and security set to low, and I have installed the Solver Add-In, but when I run the recorded Macro, an Error Message comes up: Compile Error: Sub or Function not defined. Here is the code, but I can't see how it could have a problem if Excel recorded it. Sub FindEquation() ' ' FindEquation Macro ' ' SolverOk SetCell:="$K$4", MaxMinVal:=2, ValueOf:="0", ByChange:= _ "$G$4,$H$4,$I$4" SolverSolve SolverOk SetCell:="$L$4", MaxMinVal:=2, ValueOf:="0", ByChange:= _ "$G$4,$H$4,$I$4" SolverSolve SolverOk SetCell:="$K$4", MaxMinVal:=2, ValueOf:="0", ByChange:= _ "$G$4,$H$4,$I$4" SolverSolve End Sub Any suggestions? Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
have you created a reference to the solver addin?
http://support.microsoft.com/kb/843304 even though for an earlier version of Excel, may shed some light. -- Regards, Tom Ogilvy "jswirhun" wrote: I recorded a Macro in Excel 2007 that uses the Solver, so I have macros enabled and security set to low, and I have installed the Solver Add-In, but when I run the recorded Macro, an Error Message comes up: Compile Error: Sub or Function not defined. Here is the code, but I can't see how it could have a problem if Excel recorded it. Sub FindEquation() ' ' FindEquation Macro ' ' SolverOk SetCell:="$K$4", MaxMinVal:=2, ValueOf:="0", ByChange:= _ "$G$4,$H$4,$I$4" SolverSolve SolverOk SetCell:="$L$4", MaxMinVal:=2, ValueOf:="0", ByChange:= _ "$G$4,$H$4,$I$4" SolverSolve SolverOk SetCell:="$K$4", MaxMinVal:=2, ValueOf:="0", ByChange:= _ "$G$4,$H$4,$I$4" SolverSolve End Sub Any suggestions? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2007 & Solver | Excel Discussion (Misc queries) | |||
Using Solver with Excel 2007 VBA | Excel Programming | |||
Solver in Excel 2007 | Excel Programming | |||
Where is Solver in Excel 2007? | Excel Discussion (Misc queries) | |||
Solver in excel 2007 | Excel Discussion (Misc queries) |