Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel solver in vb6.3

I have trouble getting a solver call to work, but other calls do work.
Let me show you what I have so far. On a form I have two solver calls,
the first one works but the second doesn't. What am I doing wrong?

The first one( this one works)

'//Iteration algorithm for determening the inner dia meter of the
expanded liner by using the Solver

'//Creating a temporary changing cell
Sheets("outputExpansion").Cells(150, 1) =
(Sheets("InputValues").Cells(13, 2) - 2 *
Sheets("InputValues").Cells(14, 2)) * 25.4

'//Creating a temporary target cell
If m_rho = (-2 / 3) Then

Sheets("outputExpansion").Cells(149, 1).Formula = "=$A$150 + (2
* InputValues!B14 * 25.4) * ($A$150 / ((InputValues!B13 - 2 *
InputValues!B14))* 25.4) ^ (-2 / 3) - ((InputValues!B4 - 2 *
InputValues!B2) * 25.4)"

Else

Sheets("outputExpansion").Cells(149, 1).Formula = "=$A$150 + (2
* InputValues!B14 * 25.4) * ($A$150 / ((InputValues!B13 - 2 *
InputValues!B14))* 25.4) ^ (-1) - ((InputValues!B4 - 2 *
InputValues!B2) * 25.4)"

End If

'//Actual Solver procedure
Sheets("outputExpansion").Select
solver.Auto_open
SolverOk SetCell:="$A$149", MaxMinVal:=3, ValueOf:="0",
ByChange:="$A$150"
SolverSolve UserFinish:=True
SolverFinish KeepFinal:=1
solver.Auto_close

'//The inner dia meter of the liner after the Solver procedure
de = Sheets("outputExpansion").Cells(150, 1)

'//Delete the temporary cells
Sheets("outputExpansion").Cells(150, 1).Delete
Sheets("outputExpansion").Cells(149, 1).Delete

'//================================================== ==========================

Now the second one, where I need to know the value of $A$150, B9 =
0.003, B7= 0.19 , B3 = 0.26, B2 = 0.28

'// Maximum expansion ratio for rho = -2/3

Sheets("outputExpansion").Cells(150, 1) = 0.0001

Sheets("outputExpansion").Cells(149, 1).Formula = "=((InputValues!B9 +
$A$150)/(1.52765618*
InputValues!B7))^InputValues!B7*(2.71828182845904^ (InputValues!B7 -
($A$150 + InputValues!B9)/1.52765618))- ((InputValues!B3 *
25.4)/(InputValues!B2 * 25.4)) "

'//Actual Solver procedure
Sheets("outputExpansion").Select
solver.Auto_open
SolverOk SetCell:="$A$149", MaxMinVal:=3, ValueOf:="0",
ByChange:="$A$150"
SolverSolve UserFinish:=True
SolverFinish KeepFinal:=1
solver.Auto_close


'//The inner dia meter of the liner after the Solver procedure
delta_exp_ratio = Sheets("outputExpansion").Cells(150, 1)

'//Delete the temporary cells
Sheets("outputExpansion").Cells(150, 1).Delete
Sheets("outputExpansion").Cells(149, 1).Delete


'//================================================== ===========================================

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Excel solver in vb6.3

What line is highlighted when you get the error, and what is the error
description?

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


wrote in message
ups.com...
I have trouble getting a solver call to work, but other calls do work.
Let me show you what I have so far. On a form I have two solver calls,
the first one works but the second doesn't. What am I doing wrong?

The first one( this one works)

'//Iteration algorithm for determening the inner dia meter of the
expanded liner by using the Solver

'//Creating a temporary changing cell
Sheets("outputExpansion").Cells(150, 1) =
(Sheets("InputValues").Cells(13, 2) - 2 *
Sheets("InputValues").Cells(14, 2)) * 25.4

'//Creating a temporary target cell
If m_rho = (-2 / 3) Then

Sheets("outputExpansion").Cells(149, 1).Formula = "=$A$150 + (2
* InputValues!B14 * 25.4) * ($A$150 / ((InputValues!B13 - 2 *
InputValues!B14))* 25.4) ^ (-2 / 3) - ((InputValues!B4 - 2 *
InputValues!B2) * 25.4)"

Else

Sheets("outputExpansion").Cells(149, 1).Formula = "=$A$150 + (2
* InputValues!B14 * 25.4) * ($A$150 / ((InputValues!B13 - 2 *
InputValues!B14))* 25.4) ^ (-1) - ((InputValues!B4 - 2 *
InputValues!B2) * 25.4)"

End If

'//Actual Solver procedure
Sheets("outputExpansion").Select
solver.Auto_open
SolverOk SetCell:="$A$149", MaxMinVal:=3, ValueOf:="0",
ByChange:="$A$150"
SolverSolve UserFinish:=True
SolverFinish KeepFinal:=1
solver.Auto_close

'//The inner dia meter of the liner after the Solver procedure
de = Sheets("outputExpansion").Cells(150, 1)

'//Delete the temporary cells
Sheets("outputExpansion").Cells(150, 1).Delete
Sheets("outputExpansion").Cells(149, 1).Delete

'//================================================== ==========================

Now the second one, where I need to know the value of $A$150, B9 =
0.003, B7= 0.19 , B3 = 0.26, B2 = 0.28

'// Maximum expansion ratio for rho = -2/3

Sheets("outputExpansion").Cells(150, 1) = 0.0001

Sheets("outputExpansion").Cells(149, 1).Formula = "=((InputValues!B9 +
$A$150)/(1.52765618*
InputValues!B7))^InputValues!B7*(2.71828182845904^ (InputValues!B7 -
($A$150 + InputValues!B9)/1.52765618))- ((InputValues!B3 *
25.4)/(InputValues!B2 * 25.4)) "

'//Actual Solver procedure
Sheets("outputExpansion").Select
solver.Auto_open
SolverOk SetCell:="$A$149", MaxMinVal:=3, ValueOf:="0",
ByChange:="$A$150"
SolverSolve UserFinish:=True
SolverFinish KeepFinal:=1
solver.Auto_close


'//The inner dia meter of the liner after the Solver procedure
delta_exp_ratio = Sheets("outputExpansion").Cells(150, 1)

'//Delete the temporary cells
Sheets("outputExpansion").Cells(150, 1).Delete
Sheets("outputExpansion").Cells(149, 1).Delete


'//================================================== ===========================================



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Excel solver in vb6.3

Sorry, I wasn't very specific. But there is no error (at least none
that I can recall) , the solver just doesn't run, meaning the cell
$A$150 has the same value at the end as it had in the beginning. Even
debugging the code doesn't give me any clues.


Jon Peltier schreef:

What line is highlighted when you get the error, and what is the error
description?

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


wrote in message
ups.com...
I have trouble getting a solver call to work, but other calls do work.
Let me show you what I have so far. On a form I have two solver calls,
the first one works but the second doesn't. What am I doing wrong?

The first one( this one works)

'//Iteration algorithm for determening the inner dia meter of the
expanded liner by using the Solver

'//Creating a temporary changing cell
Sheets("outputExpansion").Cells(150, 1) =
(Sheets("InputValues").Cells(13, 2) - 2 *
Sheets("InputValues").Cells(14, 2)) * 25.4

'//Creating a temporary target cell
If m_rho = (-2 / 3) Then

Sheets("outputExpansion").Cells(149, 1).Formula = "=$A$150 + (2
* InputValues!B14 * 25.4) * ($A$150 / ((InputValues!B13 - 2 *
InputValues!B14))* 25.4) ^ (-2 / 3) - ((InputValues!B4 - 2 *
InputValues!B2) * 25.4)"

Else

Sheets("outputExpansion").Cells(149, 1).Formula = "=$A$150 + (2
* InputValues!B14 * 25.4) * ($A$150 / ((InputValues!B13 - 2 *
InputValues!B14))* 25.4) ^ (-1) - ((InputValues!B4 - 2 *
InputValues!B2) * 25.4)"

End If

'//Actual Solver procedure
Sheets("outputExpansion").Select
solver.Auto_open
SolverOk SetCell:="$A$149", MaxMinVal:=3, ValueOf:="0",
ByChange:="$A$150"
SolverSolve UserFinish:=True
SolverFinish KeepFinal:=1
solver.Auto_close

'//The inner dia meter of the liner after the Solver procedure
de = Sheets("outputExpansion").Cells(150, 1)

'//Delete the temporary cells
Sheets("outputExpansion").Cells(150, 1).Delete
Sheets("outputExpansion").Cells(149, 1).Delete

'//================================================== ==========================

Now the second one, where I need to know the value of $A$150, B9 =
0.003, B7= 0.19 , B3 = 0.26, B2 = 0.28

'// Maximum expansion ratio for rho = -2/3

Sheets("outputExpansion").Cells(150, 1) = 0.0001

Sheets("outputExpansion").Cells(149, 1).Formula = "=((InputValues!B9 +
$A$150)/(1.52765618*
InputValues!B7))^InputValues!B7*(2.71828182845904^ (InputValues!B7 -
($A$150 + InputValues!B9)/1.52765618))- ((InputValues!B3 *
25.4)/(InputValues!B2 * 25.4)) "

'//Actual Solver procedure
Sheets("outputExpansion").Select
solver.Auto_open
SolverOk SetCell:="$A$149", MaxMinVal:=3, ValueOf:="0",
ByChange:="$A$150"
SolverSolve UserFinish:=True
SolverFinish KeepFinal:=1
solver.Auto_close


'//The inner dia meter of the liner after the Solver procedure
delta_exp_ratio = Sheets("outputExpansion").Cells(150, 1)

'//Delete the temporary cells
Sheets("outputExpansion").Cells(150, 1).Delete
Sheets("outputExpansion").Cells(149, 1).Delete


'//================================================== ===========================================


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Excel solver in vb6.3

Sorry, I wasn't very specific. But there is no error (at least none
that I can recall) , the solver just doesn't run, meaning the cell
$A$150 has the same value at the end as it had in the beginning. Even
debugging the code doesn't give me any clues.

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
How to replace Excel solver with some free solver codes in Excel V ct2147 Excel Programming 2 November 8th 06 07:06 PM
Using Excel Solver in VBA Antoine Cellerier Excel Programming 1 February 15th 06 10:34 AM
Interesting Solver problem (Solver encounters an error) MrShorty Excel Discussion (Misc queries) 3 December 22nd 05 10:52 PM
USING SOLVER IN EXCEL Sarah_Lecturer Excel Programming 1 February 2nd 05 02:40 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 10:09 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"