Excel solver time limit

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.
 
M

Mike Middleton

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top