View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
axel axel is offline
external usenet poster
 
Posts: 26
Default How to run Solver while viewing a graph?

Thanks again!

I am still extremely puzzeled because my solver macro behaves very strangely
indeed.

Sometime everything works quite fine, including the "live update" and
sometimes the macro still does it's job, but no output whatsoever is
displayed. (As if screenupdate was toggled off, which is not the case and as
you pointed out pointless in the solver model anyhow).

I run exactley the same macro without changing a line, and sometimes it
works sometime it doesnot...

On top sometime it just proceedes regardless what I am doing in other
windows (eg. an odd Internet explorer Window) sometimes it works until i
click on anything (outside Excel). Then it cancels and displays an error
message: "No Return() or Halt) dunction found on macro sheet.


Again the revisded code:


Sub FitAllNonZerosMacro()
starttime = Time

Windows("3__Spectrum_Fitter.xls").Activate
Sheets("Fitting").Activate
ByChangeValues = ""

SolverReset

loadminiumrestraints
loadmaximumrestraints
LoadChangeValuesforallnonZero


SolverOptions MaxTime:=16000, Iterations:=25000, Precision:=0.00000001,
IntTolerance:=0.00000001
SolverOptions StepThru:=True
SolverOptions Scaling:=True


Range("T:V").ClearContents
Cells(2, 21) = Time
Cells(3, 20) = 0
answer = SolverSolve(True, "ShowTrial")
SolverFinish KeepFinal:=1

End Sub



Function ShowTrial(Reason As Integer)
ShowTrial = False
Iterationcounter = Cells(3, 20)
Iterationcounter = Iterationcounter + 1
Cells(3, 20) = Iterationcounter
Cells(3 + Iterationcounter, 22) = Range("J13")
Cells(3 + Iterationcounter, 21) = Time - Cells(2, 21)
End Function



I guess the Solver model as good as it might be is just poorly implemented
in Excel. (I Run Excel 2003 SP3 with Windows Vista)

Maybe there is a hotfix or Update for the Solver somewhere? (Could not find
it)

Happy new year!

Axel