LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ays Ays is offline
external usenet poster
 
Posts: 4
Default Excel Solver in VB

I am trying to run this piece of code but I am getting nothing but the first
constraint in the Solver. I'd be happy is someone could help me with this.
Thanks..

Public Sub DualSolver(K, M, N)
'Activate the DLP sheet
Sheets("DLP").Activate

'Reset the solver
SolverReset

'Objective Function
SolverOk SetCell:=Range("B4"), MaxMinVal:=1, ValueOf:="0",
ByChange:="Range(Cells(2, 2), Cells(2, M + N +
1)),Range(Cells(1,M+N+6),Cells(K,M+N+6))"

'Constraints

SolverAdd CellRef:=Cells(K + 1, M + N + 6), Relation:=2, FormulaText:="1"
SolverAdd CellRef:=Range(Cells(6, 2), Cells(6, M + N + 1)), Relation:=2,
FormulaText:="Range(Cells(8, 2), Cells(8, M + N + 1))"


'Solver Options
SolverOptions MaxTime:=100, Iterations:=10000, Precision:=0.000001,
AssumeLinear _
:=True, StepThru:=False, Estimates:=1, Derivatives:=1,
SearchOption:=1, _
IntTolerance:=5, Scaling:=False, Convergence:=0.0001,
AssumeNonNeg:=True

ActiveWorkbook.Worksheets("DLP").Cells(100, 100).Formula = 1 / 0
'Solve
SolverSolve UserFinish:=True


'Finish and discard
SolverFinish KeepFinal:=2
End Sub
 
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
referencing Solver.xlam vs. Solver.xla - 2007 vs. 2003 Duke Carey Excel Programming 3 November 20th 07 03:48 PM
solver add in / excel solver / vba jerome drean[_2_] Excel Programming 8 September 21st 07 09:28 AM
How to replace Excel solver with some free solver codes in Excel V ct2147 Excel Programming 2 November 8th 06 07:06 PM
Interesting Solver problem (Solver encounters an error) MrShorty Excel Discussion (Misc queries) 3 December 22nd 05 10:52 PM
Resetting Solver Manually to Fix Solver Bug Stratuser Excel Programming 0 September 13th 04 07:04 PM


All times are GMT +1. The time now is 06:32 PM.

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

About Us

"It's about Microsoft Excel"