Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Solver -Macro

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Solver Macro Lacty Excel Programming 0 May 6th 08 10:32 AM
solver macro John Excel Programming 2 October 4th 06 05:25 AM
Macro for Solver Velero Excel Programming 2 February 19th 04 01:39 PM
Solver Macro Dick Stumbo Excel Programming 0 September 18th 03 01:55 AM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"