Problem: How to run Solver while viewing a graph?
(windows XP, Excel 2003)
The outset:
I am running a complex solver problem (typically takes a couple of minutes to hours) the results are then fed into the 20 or so cells solver may change.
These cells compute a graph in the same workbook, but on a different sheet. (The presets of the Solver are fed in by a macro)
So far everything goes along fine.
Basically what I want to do is: Display the Graph while Solver is active (to judge the progress he is making)
I tried many variants all of them failed:
First approach:
Sheets("Main Fit Chart").Activate
SolverSolve
This results in a runtime Error "1004" Method ‘Range’ of object ‘_Global’ failed. It would not be very helpful anyhow since Excel does not update the cell values while Solver is running..
My second attempt was to create a loop like this one:
SolverOptions MaxTime:=10000, Iterations:=2, Precision:=0.0000001
‘ Reducing the number of Iterations to 2 and doing this for a 1000 times:
For x = 1 To 1000
ScreenUpdating = True
Sheets("Main Fit Chart").Activate
ScreenUpdating = False
Sheets("Fitting").Select
SolverSolve
Next x
But surprisingly Solver seems more powerful than the ScreenUpdating = False command, hence the graph is only displayed for a millisecond than the fitting screen is magically activated and solver does his mystiques…
If someone feels that he could help me I would most appreciated!
Thank you much,
Axel
(windows XP, Excel 2003)
The outset:
I am running a complex solver problem (typically takes a couple of minutes to hours) the results are then fed into the 20 or so cells solver may change.
These cells compute a graph in the same workbook, but on a different sheet. (The presets of the Solver are fed in by a macro)
So far everything goes along fine.
Basically what I want to do is: Display the Graph while Solver is active (to judge the progress he is making)
I tried many variants all of them failed:
First approach:
Sheets("Main Fit Chart").Activate
SolverSolve
This results in a runtime Error "1004" Method ‘Range’ of object ‘_Global’ failed. It would not be very helpful anyhow since Excel does not update the cell values while Solver is running..
My second attempt was to create a loop like this one:
SolverOptions MaxTime:=10000, Iterations:=2, Precision:=0.0000001
‘ Reducing the number of Iterations to 2 and doing this for a 1000 times:
For x = 1 To 1000
ScreenUpdating = True
Sheets("Main Fit Chart").Activate
ScreenUpdating = False
Sheets("Fitting").Select
SolverSolve
Next x
But surprisingly Solver seems more powerful than the ScreenUpdating = False command, hence the graph is only displayed for a millisecond than the fitting screen is magically activated and solver does his mystiques…
If someone feels that he could help me I would most appreciated!
Thank you much,
Axel