Solver -Macro
On Aug 1, 4:24*pm, "Dana DeLouis" wrote:
But the thing is, even if I initialize it, it won't do anything. On some
cpu, it work very well. Is there an option I need to activate beside the
solver add in in excel and vba? Here's the code :
Hi. *Just guessing on some ideas to try. *Although basically the same, try this instead...
SOLVER.Auto_Open
instead of Application.Run "solver.xla!auto_open"
Try setting this to a value instead of a string
ValueOf:=0.70
instead of
ValueOf:="0.70"
Good luck
--
HTH *:)
Dana DeLouis
"Xavier" wrote in ...
Hi,
I have no error, but the macro just doesn't do anything. The solver.xla is
activate and also in vba.
But the thing is, even if I initialize it, it won't do anything. On some
cpu, it work very well. Is there an option I need to activate beside the
solver add in in excel and vba? Here's the code :
Sub macro1()
Dim age As Integer
Worksheets("Calcul - Cotis. fixe").Activate
Application.Run "solver.xla!auto_open"
SolverReset
For i = 1 To 300
age = CInt(Worksheets("Calcul - Cotis. fixe").Cells(i + 5, 3).Value)
* *If age = 65 Then
* * * *SolverOk SetCell:=Worksheets("Calcul - Cotis. fixe").Cells(i + 5,
21), _
* * * * * ByChange:="$T$1", MaxMinVal:=3, ValueOf:="0.70"
* * * *SolverSolve UserFinish:=True
* * * *SolverFinish KeepFinal:=1
* * * *Exit For
* *End If
Next i
end sub
I haven't used the Frontline solver in a while, but when I did Solver
only acted on the active sheet. So even though you create the
formulation on a sheet with your code, if the sheet ain't active, it
won't run.
SteveM
|