+ Reply to Thread
Results 1 to 3 of 3

Solver VB interface 'SolverOK' fails

  1. #1
    XydQyv
    Guest

    Solver VB interface 'SolverOK' fails

    I am currently using code of the form below to run solver multiple times.
    The problem that I am having is that the 'SolverOK' function does not modify
    the solver form. Running the code causes no change in the desired cells.
    Several permutations of the code have caused the referenced cells' values to
    be replaced by the string of the cells' addresses. This is running on
    MSVB6.0 with Excel 2000 9.06926 SP-3) on Windows 2000 5.00.2195, SP-3.

    After this code runs, the 'Set Target cell' and 'By Changing Cells' fields
    are blank.
    Call SOLVER.SolverReset
    Call SOLVER.SolverOK("$A$4", 3, 0#, "$B$6")
    Call SOLVER.SolverAdd("$C$36", 2, "$C$38")
    Call SOLVER.SolverSolve(True)
    Call SOLVER.SolverSave("$C$45")

    Any help, relating, or sympathy would be greatly appreciated...

  2. #2
    Mike Middleton
    Guest

    Re: Solver VB interface 'SolverOK' fails

    XydQyv -

    Chris Albright discusses a similar problem in his book "VBA for Modelers:
    Developing Decision Support Systems with Microsoft Excel." His solution is
    to repeat the first two lines of code, so the first four lines would be
    Reset, OK, Reset, OK.

    - Mike
    www.mikemiddleton.com

    "XydQyv" <[email protected]> wrote in message
    news:[email protected]...
    >I am currently using code of the form below to run solver multiple times.
    > The problem that I am having is that the 'SolverOK' function does not
    > modify
    > the solver form. Running the code causes no change in the desired cells.
    > Several permutations of the code have caused the referenced cells' values
    > to
    > be replaced by the string of the cells' addresses. This is running on
    > MSVB6.0 with Excel 2000 9.06926 SP-3) on Windows 2000 5.00.2195, SP-3.
    >
    > After this code runs, the 'Set Target cell' and 'By Changing Cells' fields
    > are blank.
    > Call SOLVER.SolverReset
    > Call SOLVER.SolverOK("$A$4", 3, 0#, "$B$6")
    > Call SOLVER.SolverAdd("$C$36", 2, "$C$38")
    > Call SOLVER.SolverSolve(True)
    > Call SOLVER.SolverSave("$C$45")
    >
    > Any help, relating, or sympathy would be greatly appreciated...




  3. #3
    Dana DeLouis
    Guest

    Re: Solver VB interface 'SolverOK' fails

    Just out of curiosity, what does your MsgBox returned. Is it False?

    Sub Demo()
    '// See if it's False
    MsgBox SOLVER.AutoOpened
    '// Then try...
    SOLVER.Auto_open
    '// Your code here...
    End Sub

    --
    Dana DeLouis
    Win XP & Office 2003


    "XydQyv" <[email protected]> wrote in message
    news:[email protected]...
    >I am currently using code of the form below to run solver multiple times.
    > The problem that I am having is that the 'SolverOK' function does not
    > modify
    > the solver form. Running the code causes no change in the desired cells.
    > Several permutations of the code have caused the referenced cells' values
    > to
    > be replaced by the string of the cells' addresses. This is running on
    > MSVB6.0 with Excel 2000 9.06926 SP-3) on Windows 2000 5.00.2195, SP-3.
    >
    > After this code runs, the 'Set Target cell' and 'By Changing Cells' fields
    > are blank.
    > Call SOLVER.SolverReset
    > Call SOLVER.SolverOK("$A$4", 3, 0#, "$B$6")
    > Call SOLVER.SolverAdd("$C$36", 2, "$C$38")
    > Call SOLVER.SolverSolve(True)
    > Call SOLVER.SolverSave("$C$45")
    >
    > Any help, relating, or sympathy would be greatly appreciated...




+ 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