View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
g.Lakshmi g.Lakshmi is offline
external usenet poster
 
Posts: 1
Default solver.xla fails

I am having problem with solver.xla. It doesnot work for
this


Private Sub CmdCompute_Click()
' ---------------------------------------------------------
-----------------------
' Author : S. Shashidhar
' Date : 28/03/2003
' Purpose : To be tested in Office SP3.
' ---------------------------------------------------------
-----------------------
Const bytGreateThanEqualTo = 3
Const bytLesserThanEqualTo = 1
Const OptimizeToMax = 1

SolverReset

SolverOk SetCell:=Range("C6"), MaxMinVal:=OptimizeToMax,
ByChange:=Range("D5:E5")

SolverAdd CellRef:=Range("F7"),
Relation:=bytLesserThanEqualTo, FormulaText:=4
SolverAdd CellRef:=Range("F8"),
Relation:=bytLesserThanEqualTo, FormulaText:=1
SolverAdd CellRef:=Range("D5"),
Relation:=bytGreateThanEqualTo, FormulaText:=0
SolverAdd CellRef:=Range("E5"),
Relation:=bytGreateThanEqualTo, FormulaText:=0


SolverOptions MaxTime:=100, Iterations:=100,
precision:=0.000001, _
assumeLinear:=False,
StepThru:=False, _
estimates:=2, derivatives:=1,
SearchOption:=1, _
intTolerance:=0.05,
scaling:=False, convergence:=0.001

SolverSolve UserFinish:=False

SolverFinish KeepFinal:=1
End Sub


where the following is the details entered in the
corresponding cells.


Z X1 X2 RHS

0 4

Objective Function 4 1 3

Constraint 1 2 1 4

Constraint 2 1 -2 -8

Kindly help in solving this issue.