+ Reply to Thread
Results 1 to 5 of 5

[SOLVED] SOLVER solversolve showref

  1. #1
    woof
    Guest

    [SOLVED] SOLVER solversolve showref

    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.



  2. #2
    Dana DeLouis
    Guest

    Re: SOLVER solversolve showref

    > > 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" <[email protected]> wrote in message
    news:[email protected]...
    > 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.
    >
    >




  3. #3
    woof
    Guest

    Re: SOLVER solversolve showref

    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" wrote:

    > > > 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" <[email protected]> wrote in message
    > news:[email protected]...
    > > 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.
    > >
    > >

    >
    >
    >


  4. #4
    woof
    Guest

    Re: SOLVER solversolve showref

    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" wrote:

    > > > 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" <[email protected]> wrote in message
    > news:[email protected]...
    > > 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.
    > >
    > >

    >
    >
    >


  5. #5
    Dana DeLouis
    Guest

    Re: SOLVER solversolve showref

    > ...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" <[email protected]> wrote in message
    news:[email protected]...
    > 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" wrote:
    >
    >> > > 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" <[email protected]> wrote in message
    >> news:[email protected]...
    >> > 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.
    >> >
    >> >

    >>
    >>
    >>




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1