SOLVER solversolve showref

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

can anyone advise how to use this solversolve option Showref:=. As far as I
can determine it takes a string argument - the name of a function,
'Showtrial' is the example used in the documentaion I can find anywhere.=.
However all my attempts to use it to take control of the solver using VBA (in
my case aiming to bypass the dialog box that appaers when the time limit on
Solver is exceed so that I don'yt have tomanually press the 'continue'
button) indicates an error in Excel - 'The formula you typed contains an
error' and subsequently I get the message 'Macro error at cell
[Solver.XLA]Excel4Functions!A18' Excel is 2002, with WinXp. Any help on why I
can't get this ShowRef:= option of solversolve to work would be very much
appreciated, thanks.
 
can anyone advise how to use this solversolve option Showref:=. ??

Hi. I can't tell where the problem is, but here are two initial thoughts.
Set this option prior to SolverSolve..
SolverOptions StepThru:=True

Also, make sure there are no spaces in any of your workbook names, as this
is an undocumented bug.
(Solver Showref can't internally parse the workbook name correctly with
spaces in the name.)
aiming to bypass the dialog box that appears when the time limit on
Solver is exceed...

I am not sure, but based on your question, would anything here help?

Results = SolverSolve(True) 'Disregard popup

Select Case Results
Case 0, 1, 2
'Solver found a solution
' Your code...
Case 10
' Max Time Limit Reached
' Your Code...
Case Else
' Other Problem...
End Select

--
HTH. :>)
Dana DeLouis
Windows XP, Office 2003


woof said:
can anyone advise how to use this solversolve option Showref:=. As far as
I
can determine it takes a string argument - the name of a function,
'Showtrial' is the example used in the documentaion I can find anywhere.=.
However all my attempts to use it to take control of the solver using VBA
(in
my case aiming to bypass the dialog box that appaers when the time limit
on
Solver is exceed so that I don'yt have tomanually press the 'continue'
button) indicates an error in Excel - 'The formula you typed contains an
error' and subsequently I get the message 'Macro error at cell
[Solver.XLA]Excel4Functions!A18' Excel is 2002, with WinXp. Any help on
why I
can't get this ShowRef:= option of solversolve to work would be very much
appreciated, thanks.
 
Dana,

many thanks, the problem seems to have been the file (*.xls) name. It was a
long name (22 charcters) no spaces in it, but it did include some '-'
charcters. Upon shorting the the name to one charcter, I have now got
further and clearly past the error on the line
.........solversolve(Userfinish:=tru, Showref:="Showtrial")

which is where it was firmly stuck before.

thank you again.

Dana DeLouis said:
Hi. I can't tell where the problem is, but here are two initial thoughts.
Set this option prior to SolverSolve..
SolverOptions StepThru:=True

Also, make sure there are no spaces in any of your workbook names, as this
is an undocumented bug.
(Solver Showref can't internally parse the workbook name correctly with
spaces in the name.)
aiming to bypass the dialog box that appears when the time limit on
Solver is exceed...

I am not sure, but based on your question, would anything here help?

Results = SolverSolve(True) 'Disregard popup

Select Case Results
Case 0, 1, 2
'Solver found a solution
' Your code...
Case 10
' Max Time Limit Reached
' Your Code...
Case Else
' Other Problem...
End Select

--
HTH. :>)
Dana DeLouis
Windows XP, Office 2003


woof said:
can anyone advise how to use this solversolve option Showref:=. As far as
I
can determine it takes a string argument - the name of a function,
'Showtrial' is the example used in the documentaion I can find anywhere.=.
However all my attempts to use it to take control of the solver using VBA
(in
my case aiming to bypass the dialog box that appaers when the time limit
on
Solver is exceed so that I don'yt have tomanually press the 'continue'
button) indicates an error in Excel - 'The formula you typed contains an
error' and subsequently I get the message 'Macro error at cell
[Solver.XLA]Excel4Functions!A18' Excel is 2002, with WinXp. Any help on
why I
can't get this ShowRef:= option of solversolve to work would be very much
appreciated, thanks.
 
...but it did include some '-' characters.

Thank you for that feedback! I've never understood why Solver can't
internally save the correct file name.
If you are interested, here is a discussion on the ShowTrial code that is
not very well documented.

Function ShowTrial(Reason As Integer)

If Reason is 2, then this code was called because the max time option was
exceeded.
At the end of you function, you have to tell the code if you want to
continue, or stop, the solver.
The only old documentation that I found had it backwards for the latest
versions of Excel, so it's a little confusing.
Here's what I use to keep it straight.

Const xContinue As Boolean = False 'Excel 2003
Const xStopRunning As Boolean = True 'Excel 2003

then in your code...
ShowTrial = xContinue
'or
ShowTrial = xStopRunning
End Function

Anyway, hope this helps.
--
Dana DeLouis
Windows XP, Office 2003


woof said:
Dana,

many thanks, the problem seems to have been the file (*.xls) name. It was
a
long name (22 charcters) no spaces in it, but it did include some '-'
charcters. Upon shorting the the name to one charcter, I have now got
further and clearly past the error on the line
........solversolve(Userfinish:=tru, Showref:="Showtrial")

which is where it was firmly stuck before.

thank you again.

Dana DeLouis said:
can anyone advise how to use this solversolve option Showref:=. ??

Hi. I can't tell where the problem is, but here are two initial
thoughts.
Set this option prior to SolverSolve..
SolverOptions StepThru:=True

Also, make sure there are no spaces in any of your workbook names, as
this
is an undocumented bug.
(Solver Showref can't internally parse the workbook name correctly with
spaces in the name.)
aiming to bypass the dialog box that appears when the time limit on
Solver is exceed...

I am not sure, but based on your question, would anything here help?

Results = SolverSolve(True) 'Disregard popup

Select Case Results
Case 0, 1, 2
'Solver found a solution
' Your code...
Case 10
' Max Time Limit Reached
' Your Code...
Case Else
' Other Problem...
End Select

--
HTH. :>)
Dana DeLouis
Windows XP, Office 2003


woof said:
can anyone advise how to use this solversolve option Showref:=. As far
as
I
can determine it takes a string argument - the name of a function,
'Showtrial' is the example used in the documentaion I can find
anywhere.=.
However all my attempts to use it to take control of the solver using
VBA
(in
my case aiming to bypass the dialog box that appaers when the time
limit
on
Solver is exceed so that I don'yt have tomanually press the 'continue'
button) indicates an error in Excel - 'The formula you typed contains
an
error' and subsequently I get the message 'Macro error at cell
[Solver.XLA]Excel4Functions!A18' Excel is 2002, with WinXp. Any help on
why I
can't get this ShowRef:= option of solversolve to work would be very
much
appreciated, thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top