Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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" wrote in message ... 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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" wrote in message ... 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
...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" wrote in message ... 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" wrote in message ... 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Interesting Solver problem (Solver encounters an error) | Excel Discussion (Misc queries) | |||
Solver: 2nd function of SolverSolve | Excel Programming | |||
Resetting Solver Manually to Fix Solver Bug | Excel Programming | |||
How does Solversolve Control Macro | Excel Programming | |||
How to call SolverSolve portably for Excel XP and Excel 2000 | Excel Programming |