View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
robs3131 robs3131 is offline
external usenet poster
 
Posts: 144
Default On Error Resume Next not stopping pop up message

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.

--
Robert


"Nigel" wrote:

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

Application.DisplayAlerts = False

' your code

Application.DisplayAlerts = True



--

Regards,
Nigel




"robs3131" wrote in message
...
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