Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2008

Tip: Looking for answers? Try searching our database.

Solver VBA - Defining Solver Options

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kyle - 13 Mar 2008 17:21 GMT
I'm using the basic version of solver that comes with excel.  I've been
defining the constraints, variables etc using VBA macros as shown in article
843304.  I now need to define the max time, number of iterations, precision
etc - basically the options that you can define from the actual Solver
Parameters window.  Does anyone know how you can define these options within
VBA code?  It isn't discussed in the aforementioned article.  Is there
perhaps another article that discusses this material?

Thanks in advance!
Jon Peltier - 13 Mar 2008 20:23 GMT
I have a bunch of links at the bottom of this page which might help:

http://peltiertech.com/Excel/SolverVBA.html

Did you try recording a macro while you adjusted these parameters?

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______

> I'm using the basic version of solver that comes with excel.  I've been
> defining the constraints, variables etc using VBA macros as shown in
[quoted text clipped - 8 lines]
>
> Thanks in advance!
Kyle - 21 Mar 2008 11:41 GMT
Thanks for your help Jon, I accidentaly found a way of setting the options
when I tried to save a model within the worksheet and then record the upload
of that scenario using a macro.  Here's the vba code template for anyone
interested:

SolverOptions MaxTime:=32767, Iterations:=32767, Precision:=0.00001, _
       AssumeLinear:=False, StepThru:=False, Estimates:=1, Derivatives:=1, _
       SearchOption:=1, IntTolerance:=5, Scaling:=False,
Convergence:=0.0001, _
       AssumeNonNeg:=False

Its fairly clear what the code refers to within the solve options window.  
The only options I've changed from the default are setting the max time and
iterations to max and perhaps altering the precision.

> I have a bunch of links at the bottom of this page which might help:
>
[quoted text clipped - 21 lines]
> >
> > Thanks in advance!
Steve - 13 Mar 2008 22:23 GMT
Where can I find Article 843304?

Thanks!

> I'm using the basic version of solver that comes with excel.  I've been
> defining the constraints, variables etc using VBA macros as shown in
[quoted text clipped - 8 lines]
>
> Thanks in advance!
Dana DeLouis - 13 Mar 2008 23:50 GMT
> Where can I find Article 843304?

Microsoft Help gets worse by the year...
Here's a simple macro I use...

Sub KB_Artilce_Number()
 Const Kb As String = "http://support.microsoft.com/kb/#/en-us"
 Dim strAdr As String

 strAdr = InputBox("Enter KB article Number")
 strAdr = Replace(Kb, "#", strAdr)

 ActiveWorkbook.FollowHyperlink Address:=strAdr, NewWindow:=True
End Sub

Signature

HTH   :>)
Dana DeLouis

> Where can I find Article 843304?
>
[quoted text clipped - 12 lines]
>>
>> Thanks in advance!
Kyle - 21 Mar 2008 11:36 GMT
I'm not sure if this is the same link that Dana gave but here's the article:

http://support.microsoft.com/kb/843304

Alternatively, if this link doesn't work search for: How to create Visual
Basic macros by using Excel Solver in Excel 97 in a google search, its the
first link.

> Where can I find Article 843304?
>
[quoted text clipped - 12 lines]
> >
> > Thanks in advance!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.