Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Question with Solver code using "Application.Run"
Hi all,
I have updated code that was working correctly to use Solver -- it was updated because of potential issues that could exist from another user using my spreadsheet on their system that has an earlier version of Excel. This issue was highlighted on the "Peltier Technical Services" website. I updated my code using the suggestions from the website to use "Application.Run". The issue is that the results of the updated code are not correct -- there are no errors, just the results are not right. Was wondering if someone could take a look at the two different pieces of code and let me know if they can see something that was not updated in the new code correctly. Old Code (working correctly): SolverReset SolverOk SetCell:="holdclearsumprod", MaxMinVal:=3, ValueOf:=Range("AL1").Value, ByChange:="holdclearbin" SolverAdd CellRef:="holdclearbin", Relation:=5, FormulaText:="binary" SolverOptions MaxTime:=100, Iterations:=100, Precision:=0.000001, AssumeLinear _ :=False, StepThru:=False, Estimates:=1, Derivatives:=1, SearchOption:=1, _ IntTolerance:=5, Scaling:=False, Convergence:=0.0001, AssumeNonNeg:=False SolverSolve userfinish:=True Updated Code (not working correctly): Application.Run "SolverReset" Application.Run "SolverOk", "holdclearsumprod", 3, "AL1", "holdclearbin" Application.Run "SolverAdd", "holdclearbin", 5, "binary" Application.Run "SolverOptions", 100, 100, 0.000001, False, False, 1, 1, 1, 5, False, 0.0001, False Application.Run "SolverSolve", True -- Robert |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
major errors with macro code - VB question constantly doing "ELSE" part of if statement | Excel Programming | |||
VBA code to "reset" application run and empty preserved arrays | Excel Programming | |||
Validation question - allow -500%, 0%, "=50%*50%" but forbid "A", "", " ", "-" ? | Excel Programming | |||
a question about "Application.GetSaveAsFileName" | Excel Programming | |||
excel.application.run macro1 -- added code to respond "yes" to a inputbox | Excel Programming |