Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default SolverOK problem - very frustrated, please help

ok, i am trying to invoke the solver from my VB code. The code works (solves) every time on MS Excel 2000 SP-1, and does not work on MS Excel 2000 SP-3. I have tried this on many different machines

I need to distribute my code to other Excel users, many of which are using Excel 2000 SP-3, so this is a big problem

ON SP3: I press "solve" and nothing happends, no error message. Has anyone else experienced this
Solverreset work
SolverOptions works (i checked, it actually changed the options in the solver
SolverAdd works (it adds the constraints
SolverOK does not work (SetCell and ByChange do NOT work, MinMaxVal and ValueOf work
SolverSolve does not work (makes sense, since SetCell and and ByChange are left blank in the solver

Any ideas

Here is the code

Private Sub SolveIt(

' SolveIt Macr
' Macro recorded 12/12/2003 by Tim Anderso

Application.ScreenUpdating = Fals
Count = Range("MatrixL").Coun
NumRows = Sqr(Count

'Reset the Solve
solvrese
SolvOptions MaxTime:=100, Iterations:=100, Precision:=0.000001, AssumeLinear
:=False, StepThru:=False, Estimates:=1, Derivatives:=1, SearchOption:=1,
IntTolerance:=5, Scaling:=True, Convergence:=0.0001, AssumeNonNeg:=Fals

'Insert new constraint
For i = 1 To NumRow
SolvAdd CellRef:=Range("MatrixLLT").Cells(i, i), Relation:=2, FormulaText:="1
Next

'Set objective function and decision variables, then solv
For j = 1 To
SolverOK SetCell:="Objective", MaxMinVal:=2, ValueOf:="0", ByChange:="DecVars
SolverSolve UserFinish = Fals
Next

SolverOK SetCell:="Objective", MaxMinVal:=2, ValueOf:="0", ByChange:="DecVars
SolverSolve UserFinish = Tru

End Su

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 634
Default SolverOK problem - very frustrated, please help

Previously posted by Dana de Louis:-

For you reference, I am running Windows 2000, Excel 2000
SP-3


XL2000: The Solver Add-in May Not Work When You Start Solver by Using a
Macro

http://support.microsoft.com/default...30&Product=xlw

CAUSE
This problem may occur after you install Microsoft Office 2000 Service Pack
3 (SP-3).

HTH.

--
Dana DeLouis
Using Windows XP & Office XP
= = = = = = = = = = = = = = = = =


--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------



"Daniel E" wrote in message
...
ok, i am trying to invoke the solver from my VB code. The code works (solves)

every time on MS Excel 2000 SP-1, and does not work on MS Excel 2000 SP-3. I
have tried this on many different machines.

I need to distribute my code to other Excel users, many of which are using

Excel 2000 SP-3, so this is a big problem.

ON SP3: I press "solve" and nothing happends, no error message. Has anyone

else experienced this?
Solverreset works
SolverOptions works (i checked, it actually changed the options in the solver)
SolverAdd works (it adds the constraints)
SolverOK does not work (SetCell and ByChange do NOT work, MinMaxVal and

ValueOf work)
SolverSolve does not work (makes sense, since SetCell and and ByChange are

left blank in the solver)

Any ideas?

Here is the code:

Private Sub SolveIt()
'
' SolveIt Macro
' Macro recorded 12/12/2003 by Tim Anderson
'
Application.ScreenUpdating = False
Count = Range("MatrixL").Count
NumRows = Sqr(Count)

'Reset the Solver
solvreset
SolvOptions MaxTime:=100, Iterations:=100, Precision:=0.000001, AssumeLinear _
:=False, StepThru:=False, Estimates:=1, Derivatives:=1, SearchOption:=1, _
IntTolerance:=5, Scaling:=True, Convergence:=0.0001, AssumeNonNeg:=False

'Insert new constraints
For i = 1 To NumRows
SolvAdd CellRef:=Range("MatrixLLT").Cells(i, i), Relation:=2,

FormulaText:="1"
Next i

'Set objective function and decision variables, then solve
For j = 1 To 3
SolverOK SetCell:="Objective", MaxMinVal:=2, ValueOf:="0",

ByChange:="DecVars"
SolverSolve UserFinish = False
Next j

SolverOK SetCell:="Objective", MaxMinVal:=2, ValueOf:="0", ByChange:="DecVars"
SolverSolve UserFinish = True

End Sub



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.572 / Virus Database: 362 - Release Date: 27/01/2004


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
So frustrated! Please help! Please HELP! Excel Discussion (Misc queries) 2 October 5th 09 05:01 PM
Frustrated onedeviousmale New Users to Excel 6 June 28th 09 08:51 PM
Frustrated Professor frustrated Professor[_2_] Excel Worksheet Functions 2 November 14th 07 05:54 PM
Frustrated Cook Wazza McG Excel Worksheet Functions 11 November 21st 05 08:56 PM
SolverOK Problem after SP-3 Update Joe Zaccardi Excel Programming 2 September 27th 03 03:43 AM


All times are GMT +1. The time now is 05:02 PM.

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"