+ Reply to Thread
Results 1 to 7 of 7

Code for automatically resuming after a message box.

  1. #1
    Forum Contributor
    Join Date
    08-14-2008
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    103

    Code for automatically resuming after a message box.

    Hi all,

    I have a piece of code wich uses the Solver in excel. Occasionally I get a message box poping up which says something like "Maximum number of iterations reached". The default option being to proceed regardless, and this is the option I will always use.

    Is there code to automatically select this option when it pops up, or to supress the message altogether?

    Thanks

    ps. increasing the default number of max iterations is not a prefered solution in this case.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Code for automatically resuming after a message box.

    Try setting the DisplayAlerts property to False before doing SolverSolve.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor
    Join Date
    08-14-2008
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    103

    Re: Code for automatically resuming after a message box.

    Do you mean put
    Please Login or Register  to view this content.

    before calling the solver?

    If so this does not work. I also tried
    Please Login or Register  to view this content.
    which also does not work

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Code for automatically resuming after a message box.

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    08-14-2008
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    103

    Re: Code for automatically resuming after a message box.

    Still no good

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Code for automatically resuming after a message box.

    OK.

    How about increasing the max number of iterations?

  7. #7
    Forum Contributor
    Join Date
    08-14-2008
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    103

    Re: Code for automatically resuming after a message box.

    Quote Originally Posted by shg View Post
    How about increasing the max number of iterations?
    This is the obvious fix. Not great, because it's still limited by an arbitary value... suppose I'll just make it really, really big.

    I was trying to avoid this but guess I'll just have to bite the bullet.

    Thanks Shg

+ 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