SolverSolve Return Values Text?

%3CLINGO-SUB%20id%3D%22lingo-sub-2784825%22%20slang%3D%22en-US%22%3ESolverSolve%20Return%20Values%20Text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2784825%22%20slang%3D%22en-US%22%3E%3CP%3EVBA%20SolverSolve%20returns%20interger%20values%200%20to%2020.%20Does%20somebody%20know%20how%20I%20can%20access%20(and%20then%20display)%20the%20associated%20texts%20as%20described%20in%20the%20documentation%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2784825%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2784879%22%20slang%3D%22en-US%22%3ERe%3A%20SolverSolve%20Return%20Values%20Text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2784879%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1164832%22%20target%3D%22_blank%22%3E%40Werner_Geiger%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENo%2C%20those%20descriptions%20are%20not%20exposed%20in%20VBA.%20You%20could%20create%20code%20for%20it%20yourself%3A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-visual-basic%22%3E%3CCODE%3E%20%20%20%20Dim%20strResult%20As%20String%0A%20%20%20%20Select%20Case%20Solver.SolverSolve(True)%0A%20%20%20%20%20%20%20%20Case%201%0A%20%20%20%20%20%20%20%20%20%20%20%20strResult%20%3D%20%22Solver%20found%20a%20solution.%20All%20constraints%20and%20optimality%20conditions%20are%20satisfied.%22%0A%20%20%20%20%20%20%20%20Case%202%0A%20%20%20%20%20%20%20%20%20%20%20%20...%0A%20%20%20%20End%20Select%0A%20%20%20%20MsgBox%20strResult%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

VBA SolverSolve returns interger values 0 to 20. Does somebody know how I can access (and then display) the associated texts as described in the documentation?

2 Replies

@Werner_Geiger 

No, those descriptions are not exposed in VBA. You could create code for it yourself:

    Dim strResult As String
    Select Case Solver.SolverSolve(True)
        Case 1
            strResult = "Solver found a solution. All constraints and optimality conditions are satisfied."
        Case 2
            ...
    End Select
    MsgBox strResult
OK. This is what I did already. Thanks