G
Guest
ok, i am trying to invoke the solver from my VB code. The code works (solves) every time on MS Excel 2000 SP-1, and does not work on MS Excel 2000 SP-3. I have tried this on many different machines
I need to distribute my code to other Excel users, many of which are using Excel 2000 SP-3, so this is a big problem
ON SP3: I press "solve" and nothing happends, no error message. Has anyone else experienced this
Solverreset work
SolverOptions works (i checked, it actually changed the options in the solver
SolverAdd works (it adds the constraints
SolverOK does not work (SetCell and ByChange do NOT work, MinMaxVal and ValueOf work
SolverSolve does not work (makes sense, since SetCell and and ByChange are left blank in the solver
Any ideas
Here is the code
Private Sub SolveIt(
' SolveIt Macr
' Macro recorded 12/12/2003 by Tim Anderso
Application.ScreenUpdating = Fals
Count = Range("MatrixL").Coun
NumRows = Sqr(Count
'Reset the Solve
solvrese
SolvOptions MaxTime:=100, Iterations:=100, Precision:=0.000001, AssumeLinear
:=False, StepThru:=False, Estimates:=1, Derivatives:=1, SearchOption:=1,
IntTolerance:=5, Scaling:=True, Convergence:=0.0001, AssumeNonNeg:=Fals
'Insert new constraint
For i = 1 To NumRow
SolvAdd CellRef:=Range("MatrixLLT").Cells(i, i), Relation:=2, FormulaText:="1
Next
'Set objective function and decision variables, then solv
For j = 1 To
SolverOK SetCell:="Objective", MaxMinVal:=2, ValueOf:="0", ByChange:="DecVars
SolverSolve UserFinish = Fals
Next
SolverOK SetCell:="Objective", MaxMinVal:=2, ValueOf:="0", ByChange:="DecVars
SolverSolve UserFinish = Tru
End Su
I need to distribute my code to other Excel users, many of which are using Excel 2000 SP-3, so this is a big problem
ON SP3: I press "solve" and nothing happends, no error message. Has anyone else experienced this
Solverreset work
SolverOptions works (i checked, it actually changed the options in the solver
SolverAdd works (it adds the constraints
SolverOK does not work (SetCell and ByChange do NOT work, MinMaxVal and ValueOf work
SolverSolve does not work (makes sense, since SetCell and and ByChange are left blank in the solver
Any ideas
Here is the code
Private Sub SolveIt(
' SolveIt Macr
' Macro recorded 12/12/2003 by Tim Anderso
Application.ScreenUpdating = Fals
Count = Range("MatrixL").Coun
NumRows = Sqr(Count
'Reset the Solve
solvrese
SolvOptions MaxTime:=100, Iterations:=100, Precision:=0.000001, AssumeLinear
:=False, StepThru:=False, Estimates:=1, Derivatives:=1, SearchOption:=1,
IntTolerance:=5, Scaling:=True, Convergence:=0.0001, AssumeNonNeg:=Fals
'Insert new constraint
For i = 1 To NumRow
SolvAdd CellRef:=Range("MatrixLLT").Cells(i, i), Relation:=2, FormulaText:="1
Next
'Set objective function and decision variables, then solv
For j = 1 To
SolverOK SetCell:="Objective", MaxMinVal:=2, ValueOf:="0", ByChange:="DecVars
SolverSolve UserFinish = Fals
Next
SolverOK SetCell:="Objective", MaxMinVal:=2, ValueOf:="0", ByChange:="DecVars
SolverSolve UserFinish = Tru
End Su