Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 144
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help displaying "Maximum" or "Minimum" if cell is max or min in a group? RussAllison Excel Discussion (Misc queries) 1 February 24th 11 02:22 AM
Stop the "Personal" sheet from popping up every time I open a work George B Excel Discussion (Misc queries) 2 December 21st 07 10:46 PM
How do I stop "&T" in AT&T from displaying time in Excel footer? M. Harper Setting up and Configuration of Excel 2 April 29th 07 02:10 PM
can alarm be coded into a cell "x" hours before date's reached ? amblebookworm Excel Worksheet Functions 1 April 7th 07 01:00 PM
Stop users from accessing "Protection" option from "Tools" menu I Believe Excel Programming 2 December 19th 05 02:44 PM


All times are GMT +1. The time now is 01:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"