Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Solver VB interface 'SolverOK' fails

I am currently using code of the form below to run solver multiple times.
The problem that I am having is that the 'SolverOK' function does not modify
the solver form. Running the code causes no change in the desired cells.
Several permutations of the code have caused the referenced cells' values to
be replaced by the string of the cells' addresses. This is running on
MSVB6.0 with Excel 2000 9.06926 SP-3) on Windows 2000 5.00.2195, SP-3.

After this code runs, the 'Set Target cell' and 'By Changing Cells' fields
are blank.
Call SOLVER.SolverReset
Call SOLVER.SolverOK("$A$4", 3, 0#, "$B$6")
Call SOLVER.SolverAdd("$C$36", 2, "$C$38")
Call SOLVER.SolverSolve(True)
Call SOLVER.SolverSave("$C$45")

Any help, relating, or sympathy would be greatly appreciated...
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Solver VB interface 'SolverOK' fails

XydQyv -

Chris Albright discusses a similar problem in his book "VBA for Modelers:
Developing Decision Support Systems with Microsoft Excel." His solution is
to repeat the first two lines of code, so the first four lines would be
Reset, OK, Reset, OK.

- Mike
www.mikemiddleton.com

"XydQyv" wrote in message
...
I am currently using code of the form below to run solver multiple times.
The problem that I am having is that the 'SolverOK' function does not
modify
the solver form. Running the code causes no change in the desired cells.
Several permutations of the code have caused the referenced cells' values
to
be replaced by the string of the cells' addresses. This is running on
MSVB6.0 with Excel 2000 9.06926 SP-3) on Windows 2000 5.00.2195, SP-3.

After this code runs, the 'Set Target cell' and 'By Changing Cells' fields
are blank.
Call SOLVER.SolverReset
Call SOLVER.SolverOK("$A$4", 3, 0#, "$B$6")
Call SOLVER.SolverAdd("$C$36", 2, "$C$38")
Call SOLVER.SolverSolve(True)
Call SOLVER.SolverSave("$C$45")

Any help, relating, or sympathy would be greatly appreciated...



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 690
Default Solver VB interface 'SolverOK' fails

Just out of curiosity, what does your MsgBox returned. Is it False?

Sub Demo()
'// See if it's False
MsgBox SOLVER.AutoOpened
'// Then try...
SOLVER.Auto_open
'// Your code here...
End Sub

--
Dana DeLouis
Win XP & Office 2003


"XydQyv" wrote in message
...
I am currently using code of the form below to run solver multiple times.
The problem that I am having is that the 'SolverOK' function does not
modify
the solver form. Running the code causes no change in the desired cells.
Several permutations of the code have caused the referenced cells' values
to
be replaced by the string of the cells' addresses. This is running on
MSVB6.0 with Excel 2000 9.06926 SP-3) on Windows 2000 5.00.2195, SP-3.

After this code runs, the 'Set Target cell' and 'By Changing Cells' fields
are blank.
Call SOLVER.SolverReset
Call SOLVER.SolverOK("$A$4", 3, 0#, "$B$6")
Call SOLVER.SolverAdd("$C$36", 2, "$C$38")
Call SOLVER.SolverSolve(True)
Call SOLVER.SolverSave("$C$45")

Any help, relating, or sympathy would be greatly appreciated...



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
VBA SolverOK not inputting all values into Solver... Paul Excel Programming 0 February 24th 05 06:05 PM
solver.xla fails g.Lakshmi Excel Programming 1 August 23rd 04 11:57 AM
SolverOK, he not so OK toby Excel Programming 0 July 30th 04 01:09 PM
SolverOK problem - very frustrated, please help Daniel E Excel Programming 1 January 29th 04 09:40 PM
Solver Fails in Excel XP Martin[_7_] Excel Programming 3 August 8th 03 04:25 PM


All times are GMT +1. The time now is 05:13 AM.

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"