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

Hello!

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

Hannu Rantala
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 690
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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
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



All times are GMT +1. The time now is 03:03 AM.

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

About Us

"It's about Microsoft Excel"