Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 144
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
major errors with macro code - VB question constantly doing "ELSE" part of if statement [email protected][_2_] Excel Programming 2 June 12th 07 10:00 PM
VBA code to "reset" application run and empty preserved arrays [email protected] Excel Programming 2 May 9th 07 11:40 AM
Validation question - allow -500%, 0%, "=50%*50%" but forbid "A", "", " ", "-" ? tskogstrom Excel Programming 2 November 27th 06 09:50 AM
a question about "Application.GetSaveAsFileName" 12Keys Excel Programming 2 April 13th 06 06:25 AM
excel.application.run macro1 -- added code to respond "yes" to a inputbox Michael Joe Excel Programming 3 August 13th 04 10:11 PM


All times are GMT +1. The time now is 08:37 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"