Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sover -- how do you stop "The maximum time limit was reached..." b
Hi all,
I am using Solver as part of a large piece of code -- the code below is specific to Solver. The issue I have is that the message "The maximum time limit was reached; continue anyway?" comes up when the max time limit is reached. I would like the code to keep going so users aren't bothered with the menu. Specifically, I would like to automate the selecting of the "Stop" button -- I want this to be transparent to the user so they don't even see the menu come up. Apparently "Application.DisplayAlerts = False" doesn't do this (makes sense since it's not clear what the user's choice would be). Any help is appreciated! Code: With Sheets("Transaction Summary") 'Set $ range ActiveWorkbook.Names.Add Name:="payfclearcomm", _ RefersTo:=.Range(.Range("L1").End(xlDown), .Range("L65536").End(xlUp)) 'Set binary range ActiveWorkbook.Names.Add Name:="payfclearbin", _ RefersTo:=.Range(.Range("AA1").End(xlDown).Offset( 0, 1), ..Range("AA65536").End(xlUp).Offset(0, 1)) 'Set month range ActiveWorkbook.Names.Add Name:="payfclearmonth", _ RefersTo:=.Range(.Range("AA1").End(xlDown).Offset( 0, 2), ..Range("AA65536").End(xlUp).Offset(0, 2)) 'Set sumif for Forward Balance total .Range("AD1").Formula = _ "=SUMIF(Linkpayholdclear!C[-23],Linkpayhold!R[1]C[-18],Linkpayholdclear!C[-28])" 'Set format of cell AD1 .Range("AD1").NumberFormat = "0.00000" 'Set commission sumproduct .Range("AE1").Formula = "=SUMPRODUCT(payfclearcomm,payfclearbin)" 'Set month weight sumproduct .Range("AF1").Formula = "=SUMPRODUCT(payfclearbin,payfclearmonth)" 'Solver execution Sheets("Transaction Summary").Activate SolverReset Application.DisplayAlerts = False SolverOk SetCell:="$AF$1", MaxMinVal:=2, ValueOf:="0", ByChange:="payfclearbin" SolverAdd CellRef:="payfclearbin", Relation:=5, FormulaText:="binary" SolverAdd CellRef:="$AE$1", Relation:=2, FormulaText:="$AD$1" SolverOptions MaxTime:=10, 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 Application.DisplayAlerts = True Else End If End With -- Robert |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Help displaying "Maximum" or "Minimum" if cell is max or min in a group? | Excel Discussion (Misc queries) | |||
Stop the "Personal" sheet from popping up every time I open a work | Excel Discussion (Misc queries) | |||
How do I stop "&T" in AT&T from displaying time in Excel footer? | Setting up and Configuration of Excel | |||
can alarm be coded into a cell "x" hours before date's reached ? | Excel Worksheet Functions | |||
Stop users from accessing "Protection" option from "Tools" menu | Excel Programming |