+ Reply to Thread
Results 1 to 3 of 3

Solver Max Time dialog

  1. #1
    Ariel
    Guest

    Solver Max Time dialog

    I've got a Solver problem set up in an Excel workbook. There is a
    macro that runs the Solver. I would like to add to the VBA code a way
    to stop running Solver after the max time (set up in the Solver options
    prior to running the macro) has been reached. I would like to do so in
    a way that there is no dialogue box for the user; I want to create one
    macro that runs Solver on several spreadsheets, each of which depends
    on the results from the prior sheet. I would like this to be fully
    automated.


  2. #2
    Dana DeLouis
    Guest

    Re: Solver Max Time dialog

    Hi. I don't follow, but see if there are any ideas in this small demo that
    may help you. Post back with any questions. HTH :>)

    Sub Demo()
    '// = = = = = = = = = = = = = = = = = = = = = = = = = = = =
    '// Reference: http://www.solver.com/suppstdmsgresult.htm
    '// = = = = = = = = = = = = = = = = = = = = = = = = = = = =

    ' Set up Solver
    ' ...
    ' Set up Options
    SolverOptions MaxTime:=90 'Max of 90 Seconds!

    ' Now solve, but remember why Solver stopped
    Result = SolverSolve(True)

    '// Why did Solver Stop?
    Select Case Result
    Case 0, 1, 2 'Solution is ok
    'Your code...
    Case 10
    'Stop chosen when the maximum time limit was reached.
    'Your code here...
    End Select

    End Sub

    --
    Dana DeLouis
    Win XP & Office 2003


    "Ariel" <honest_ariel@yahoo.com> wrote in message
    news:1115833935.738813.282630@g14g2000cwa.googlegroups.com...
    > I've got a Solver problem set up in an Excel workbook. There is a
    > macro that runs the Solver. I would like to add to the VBA code a way
    > to stop running Solver after the max time (set up in the Solver options
    > prior to running the macro) has been reached. I would like to do so in
    > a way that there is no dialogue box for the user; I want to create one
    > macro that runs Solver on several spreadsheets, each of which depends
    > on the results from the prior sheet. I would like this to be fully
    > automated.
    >




  3. #3
    Registered User
    Join Date
    10-17-2005
    Posts
    10

    Continuation of the discussion on Solver Trial solution dialog

    HI Dana:
    I am happy to see the solution you provided for Ariel. Howver, I am not able to find the precise statement that I can use to "automatically" stop the solver (and move to the next iteration step) INSTEAD of the user having to press the STOP button on the "Show Trial Solution" Dialog box (when result = 3 , maximum iteration reached)

    Can you help? I could not find any funciton in SOLVERADD etc that does the trick.
    Thanks in advance
    msuryexcel

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1