Results 1 to 2 of 2

Solver macro... bypass no feasible solution popup

Threaded View

  1. #1
    Forum Contributor
    Join Date
    04-19-2009
    Location
    Toulouse, France
    MS-Off Ver
    Excel 2010
    Posts
    130

    Solver macro... bypass no feasible solution popup

    hello all,

    I am having issues with the code below. Firstly when i run it on occassion there is no feasible solution which is fine it will happen on occassion. Though the popup telling me there is no feasible solution i would like to prevent from popping up. I thought the UserFinish:=True was supposed to do this. is there something i can put in the code below to prevent this from happening. Secondly the the macro is being called even though there is no "y" in j14 any ideas why? Any help appreciated.

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Range("J14").Value = "y" Then
    Call Freeme
    End If
    End Sub
    
    Sub Freeme()
    
        SolverReset
        SolverOk SetCell:="$H$35", _
        MaxMinVal:=2, _
        ValueOf:=0, _
        ByChange:="$G$22:$L$22", _
            Engine:=1, _
            EngineDesc:="GRG Nonlinear"
        SolverAdd CellRef:=Range("$G$22:$L$22"), Relation:=1, FormulaText:="20"
        SolverAdd CellRef:=Range("$G$22:$L$22"), Relation:=3, FormulaText:="2"
        SolverAdd CellRef:=Range("$H$24:$H$33"), Relation:=3, FormulaText:="0"
        SolverSolve
        SolverSolve UserFinish:=True
        SolverFinish KeepFinal:=1
    End Sub


    Regards
    Dan
    Last edited by Cicada; 04-26-2012 at 11:56 AM. Reason: precision

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