Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello all,
I am running an optimization problem and am using function to iterate solver. ------------------------------------------------------------------------- Private Function RunSolverNoLimit(vCosts As String, vVols As String, vChk As String, vSales As String) Application.ScreenUpdating = False SolverReset SolverOk SetCell:=vCosts, MaxMinVal:=2, ByChange:=vVols, Engine:=2 SolverOptions AssumeNonNeg:=True SolverAdd CellRef:=vChk, Relation:=2, FormulaText:=vSales SolverSolve UserFinish:=True Solverfinish Keepfinal:=1 Application.ScreenUpdating = True End Function ------------------------------------------------------------------------- All the arguments are Named ranges in the same sheet as the function. This code is working in one file but not in the other. In the new file, the function just dies out after SolverSolve, never reaching SolverFinish. It does solve the problem though. Interestingly, when I track the function by 'Stepping in', I can run the SolverSolve in the debug box and it works without ending the function. However if the line in the function executes, the optimization goes through but the routine just exits (and I mean it doesn't go back to the calling function; instead the whole run ends). Any ideas? Best regards, Ashish |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
SolverSolve return values | Excel Programming | |||
SOLVER solversolve showref | Excel Programming | |||
Solver: 2nd function of SolverSolve | Excel Programming | |||
How does Solversolve Control Macro | Excel Programming | |||
Excel2000 VBA - Workbook size increases abnormally. | Excel Programming |