On Error Resume Next not stopping pop up message

R

robs3131

Hi all,

I have an issue where I am using Solver in my code -- the issue is that once
in a while, the time limit set is exceeded and a message pops asking the user
to select what to do. Below is the Solver code and the message that comes up
-- "On Error Resume Next" is not stopping the message from coming up:

Code:
SolverReset
On Error Resume Next
SolverOk SetCell:="holdclearsumprod", MaxMinVal:=3,
ValueOf:=Range("AL1").Value, ByChange:="holdclearbin"
SolverAdd CellRef:="holdclearbin", Relation:=5, FormulaText:="binary"
SolverOptions MaxTime:=100, Iterations:=100, Precision:=0.000001,
AssumeLinear _
:=False, StepThru:=False, Estimates:=1, Derivatives:=1, SearchOption:=1, _
IntTolerance:=5, Scaling:=False, Convergence:=0.0001, AssumeNonNeg:=False
SolverSolve userfinish:=True

--------------
Message:
"The maximum time limit was reached; continue anyway?

"Continue" "Stop" "Help" "Save Scenario"

--------------
I would like to have the "Stop" selection picked every time by the code when
this situation occurs so that the user does not have to pick anything. Was
wondering what the best way is to do this? I tried "On Error Resume Next" as
seen in the code above, but it is not stopping the message from coming up.

Thanks!

Robert
 
N

Nigel

Not sure about the add-in, but you could try using....

Application.DisplayAlerts = False

' your code

Application.DisplayAlerts = True
 
R

robs3131

Thanks Nigel - that worked.

I would still be curious to know if there is a way to automatically have
"Stop" chosen at the time that that alert is supposed to come up.
 

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