Excel solver time limit

  • Thread starter Thread starter David
  • Start date Start date
D

David

I am using VBA script to run the standard excel solver
automatically every minute or so in an excel spreadsheet
and it runs reasonably well however occasionally (Once
every 12 to 24 hrs) I receive a dialog box indicating "The
maximum time limit was reached; continue anyway?". Is
there VB code I can use to automatically close this
dialogue if it appears box by choosing 'stop'
or 'continue' or will a user have to manually intervene?
For example I use "SolverSolve UserFinish:=True"
and "SolverFinish" in my current code to prevent user
intervention. I have tried extending the maximum time in
the options and that does not appear to make a large
difference.
 
David -

The SolverSolve function returns an integer value indicating what happened.
I think 0,1,2 indicate various kinds of success, but I don't have the list
handy. Maybe you could check the function result like this:

If SolverSolve(UserFinish:=True) > 2 Then ... Else ...

And I don't know if this will avoid the dialog box.

- Mike Middleton, www.usfca.edu/~middleton

+++++++++++++++++++++++++++++++++

I am using VBA script to run the standard excel solver
automatically every minute or so in an excel spreadsheet
and it runs reasonably well however occasionally (Once
every 12 to 24 hrs) I receive a dialog box indicating "The
maximum time limit was reached; continue anyway?". Is
there VB code I can use to automatically close this
dialogue if it appears box by choosing 'stop'
or 'continue' or will a user have to manually intervene?
For example I use "SolverSolve UserFinish:=True"
and "SolverFinish" in my current code to prevent user
intervention. I have tried extending the maximum time in
the options and that does not appear to make a large
difference.
 
Back
Top