ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   solverresults (https://www.excelbanter.com/excel-programming/294247-solverresults.html)

Hannu Rantala

solverresults
 
Hello!

Which would be the correct command in solver macro to shut
solverresults-window after iteration? SolverFinish doesn't do that.

Hannu Rantala

Dana DeLouis[_3_]

solverresults
 
I think you want to use the following:

SolverSolve True

If you wish to use the results with "SolverFinish", then here is just one
idea.

Sub Demo()
'// Dana DeLouis
Dim WhatHappened
Const KeepSolution = 1
Const DiscardSolution = 2

'// Don't display Solver

WhatHappened = SolverSolve(True)

Select Case WhatHappened
Case 1 To 3
'Solution should be ok
SolverFinish KeepSolution
Case Else
SolverFinish DiscardSolution
End Select
End Sub

HTH. :)

--
Dana DeLouis
Using Windows XP & Office XP
= = = = = = = = = = = = = = = = =


"Hannu Rantala" wrote in message
om...
Hello!

Which would be the correct command in solver macro to shut
solverresults-window after iteration? SolverFinish doesn't do that.

Hannu Rantala




Hannu Rantala

solverresults
 
"Dana DeLouis" wrote in message ...
I think you want to use the following:

SolverSolve True

If you wish to use the results with "SolverFinish", then here is just one
idea.

Sub Demo()
'// Dana DeLouis
Dim WhatHappened
Const KeepSolution = 1
Const DiscardSolution = 2

'// Don't display Solver

WhatHappened = SolverSolve(True)

Select Case WhatHappened
Case 1 To 3
'Solution should be ok
SolverFinish KeepSolution
Case Else
SolverFinish DiscardSolution
End Select
End Sub

HTH. :)

--
Dana DeLouis
Using Windows XP & Office XP
= = = = = = = = = = = = = = = = =

Hello!

Having problems with code...how to use the command above?

i have this kind of code now:
Private Sub CommandButton1_Click()

Worksheets("Taul2").Activate
SolvReset
SolvOptions AssumeNonNeg:=True

SolvOk SetCell:="B22", MaxMinVal:=3, ValueOf:="0",
ByChange:="B5,B7,B9"
SolvAdd CellRef:="B4", Relation:=2, FormulaText:="B6"
SolvAdd CellRef:="B5", Relation:=2, FormulaText:="B8"
SolvSolve

SolvReset
SolvOptions AssumeNonNeg:=True
SolvOk SetCell:="C22", MaxMinVal:=3, ValueOf:="0",
ByChange:="C5,C7,C9"
SolvAdd CellRef:="C4", Relation:=2, FormulaText:="C6"
SolvAdd CellRef:="C5", Relation:=2, FormulaText:="C8"
SolvSolve

Hannu Rantala

solverresults
 
"Dana DeLouis" wrote in message ...
I think you want to use the following:

SolverSolve True

If you wish to use the results with "SolverFinish", then here is just one
idea.

Sub Demo()
'// Dana DeLouis
Dim WhatHappened
Const KeepSolution = 1
Const DiscardSolution = 2

'// Don't display Solver

WhatHappened = SolverSolve(True)

Select Case WhatHappened
Case 1 To 3
'Solution should be ok
SolverFinish KeepSolution
Case Else
SolverFinish DiscardSolution
End Select
End Sub

HTH. :)

--
Dana DeLouis
Using Windows XP & Office XP
= = = = = = = = = = = = = = = = =


Ohhoh!

I must be very good sleeping programmer! SolverFinish True does
exactly what I want. Forget my previous message. And thanks for help
because your notification woke me up!
Hannu


All times are GMT +1. The time now is 05:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com