+ Reply to Thread
Results 1 to 4 of 4

Button press automation in Macros

  1. #1
    Registered User
    Join Date
    05-07-2010
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    1

    Button press automation in Macros

    I'm trying to automatically solve multiple lines of solver conditions on a single worksheet (excel 2007). However, every time solver finishes the calculation for one line, it raises a dialog box asking me whether I want to retain the solver solution. How do I automate the "press OK" event in the VBA code? Here's part of the resulting code:

    .....
    SolverReset
    SolverOk SetCell:="$O$5", MaxMinVal:=2, ValueOf:="0", ByChange:="$L$5"
    SolverAdd CellRef:="$O$5", Relation:=3, FormulaText:="$DU$5"
    SolverOk SetCell:="$O$5", MaxMinVal:=2, ValueOf:="0", ByChange:="$L$5"
    SolverAdd CellRef:="$L$5", Relation:=3, FormulaText:="$DW$5"
    SolverOk SetCell:="$O$5", MaxMinVal:=2, ValueOf:="0", ByChange:="$L$5"
    SolverSolve
    SolverReset
    SolverOk SetCell:="$O$6", MaxMinVal:=2, ValueOf:="0", ByChange:="$L$6"
    .....


    Thanks!

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Button press automation in Macros

    Please enclose your code in code tags ([code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code]) or we can't answer you.
    Remember what the dormouse said
    Feed your head

  3. #3
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Button press automation in Macros

    Try

    Please Login or Register  to view this content.

    Sorry romperstomper posts crossed and missed your request to OP

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Button press automation in Macros

    Don't worry about me - I'm not a mod!

+ 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