Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
"unexpected error" when running solver from a macro
hi there, i'm having trouble running the solver from a macro and i was wonderin if you guys could help me with it the error message is "Solver: An unexpected internal error occured, or available memory wa exhausted." here's the code: SolverReset SolverAdd CellRef:=cellrefstring1, Relation:=2 FormulaText:=cellrefstring2 SolverOptions Iterations:=32767, Precision:=0.1, StepThru:=False Estimates:=2, Derivatives:=1, SearchOption:=1, Scaling:=False Convergence:=0.1, AssumeNonNeg:=False, AssumeLinear _ :=True SolverOk MaxMinVal:=3, ValueOf:="0", ByChange:=bychangestring SolverSolve "cellrefstring1" and "bychangestring" are string-type variables. running the macro line by line, i found that the error occurs after th SolverOk line. i also realised that if i dont leave the "SetCell" option empty, an set it to a dummy cell (that isnt affected by the ByChange cells), will not have this problem on my computer. however this "workaround" didnt work on almost every other compute i've tried. i use excel 2002. i've tried this code on a few machine running excel 2002 and 2003. i doubt it is a problem with referencing to solver.xla because i chec this everytime before i run the macro on a different machine. if this is an old problem that has been mentioned before, i woul gladly do a readup if someone would give me directions or point me to page/thread. thanks in advanc -- floodgat ----------------------------------------------------------------------- floodgate's Profile: http://www.excelforum.com/member.php...fo&userid=1477 View this thread: http://www.excelforum.com/showthread.php?threadid=26429 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
"unexpected error" when running solver from a macro
If you run Solver once manually before calling it in code, does it then work
flawlessly when called from code? If so, then running this when your file opens might "solve" your problem: Sub AutoOpenSolver() If Not SOLVER.Solver1.AutoOpened Then SOLVER.Solver2.Auto_Open End If End Sub I went round in circles with this problem, even contacting the Frontline Systems people. Finally around 2:30 one fine morning, I saw an archived newsgroup post with this code, and we've had no problems with Solver since then. - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ floodgate wrote: hi there, i'm having trouble running the solver from a macro and i was wondering if you guys could help me with it the error message is "Solver: An unexpected internal error occured, or available memory was exhausted." here's the code: SolverReset SolverAdd CellRef:=cellrefstring1, Relation:=2, FormulaText:=cellrefstring2 SolverOptions Iterations:=32767, Precision:=0.1, StepThru:=False, Estimates:=2, Derivatives:=1, SearchOption:=1, Scaling:=False, Convergence:=0.1, AssumeNonNeg:=False, AssumeLinear _ :=True SolverOk MaxMinVal:=3, ValueOf:="0", ByChange:=bychangestring SolverSolve "cellrefstring1" and "bychangestring" are string-type variables. running the macro line by line, i found that the error occurs after the SolverOk line. i also realised that if i dont leave the "SetCell" option empty, and set it to a dummy cell (that isnt affected by the ByChange cells), i will not have this problem on my computer. however this "workaround" didnt work on almost every other computer i've tried. i use excel 2002. i've tried this code on a few machines running excel 2002 and 2003. i doubt it is a problem with referencing to solver.xla because i check this everytime before i run the macro on a different machine. if this is an old problem that has been mentioned before, i would gladly do a readup if someone would give me directions or point me to a page/thread. thanks in advance |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
"unexpected error" when running solver from a macro
Let me rephrase that. We've had no problems until about 9 pm, and now it's not
working on the client's machine. I'll post back when it's working again. - Jon Jon Peltier wrote: If you run Solver once manually before calling it in code, does it then work flawlessly when called from code? If so, then running this when your file opens might "solve" your problem: Sub AutoOpenSolver() If Not SOLVER.Solver1.AutoOpened Then SOLVER.Solver2.Auto_Open End If End Sub I went round in circles with this problem, even contacting the Frontline Systems people. Finally around 2:30 one fine morning, I saw an archived newsgroup post with this code, and we've had no problems with Solver since then. - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ floodgate wrote: hi there, i'm having trouble running the solver from a macro and i was wondering if you guys could help me with it the error message is "Solver: An unexpected internal error occured, or available memory was exhausted." here's the code: SolverReset SolverAdd CellRef:=cellrefstring1, Relation:=2, FormulaText:=cellrefstring2 SolverOptions Iterations:=32767, Precision:=0.1, StepThru:=False, Estimates:=2, Derivatives:=1, SearchOption:=1, Scaling:=False, Convergence:=0.1, AssumeNonNeg:=False, AssumeLinear _ :=True SolverOk MaxMinVal:=3, ValueOf:="0", ByChange:=bychangestring SolverSolve "cellrefstring1" and "bychangestring" are string-type variables. running the macro line by line, i found that the error occurs after the SolverOk line. i also realised that if i dont leave the "SetCell" option empty, and set it to a dummy cell (that isnt affected by the ByChange cells), i will not have this problem on my computer. however this "workaround" didnt work on almost every other computer i've tried. i use excel 2002. i've tried this code on a few machines running excel 2002 and 2003. i doubt it is a problem with referencing to solver.xla because i check this everytime before i run the macro on a different machine. if this is an old problem that has been mentioned before, i would gladly do a readup if someone would give me directions or point me to a page/thread. thanks in advance |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
"unexpected error" when running solver from a macro
I have got the same problem with running Solver from a
macro. I have isolated the problem as a failiure of the SolverOK function to populate the target and changing cells in the dialogue box. If the solver was previouly run manually and cell addresses are retained in the boxes then the macro will appear to run. If SolverReset is used before running the Solver code it certainly not work. The SolverAdd function does populate the constraints box. This leads me to conclude it is a Mirosoft bug. How does one go about letting them know? -----Original Message----- Let me rephrase that. We've had no problems until about 9 pm, and now it's not working on the client's machine. I'll post back when it's working again. - Jon Jon Peltier wrote: If you run Solver once manually before calling it in code, does it then work flawlessly when called from code? If so, then running this when your file opens might "solve" your problem: Sub AutoOpenSolver() If Not SOLVER.Solver1.AutoOpened Then SOLVER.Solver2.Auto_Open End If End Sub I went round in circles with this problem, even contacting the Frontline Systems people. Finally around 2:30 one fine morning, I saw an archived newsgroup post with this code, and we've had no problems with Solver since then. - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ floodgate wrote: hi there, i'm having trouble running the solver from a macro and i was wondering if you guys could help me with it the error message is "Solver: An unexpected internal error occured, or available memory was exhausted." here's the code: SolverReset SolverAdd CellRef:=cellrefstring1, Relation:=2, FormulaText:=cellrefstring2 SolverOptions Iterations:=32767, Precision:=0.1, StepThru:=False, Estimates:=2, Derivatives:=1, SearchOption:=1, Scaling:=False, Convergence:=0.1, AssumeNonNeg:=False, AssumeLinear _ :=True SolverOk MaxMinVal:=3, ValueOf:="0", ByChange:=bychangestring SolverSolve "cellrefstring1" and "bychangestring" are string-type variables. running the macro line by line, i found that the error occurs after the SolverOk line. i also realised that if i dont leave the "SetCell" option empty, and set it to a dummy cell (that isnt affected by the ByChange cells), i will not have this problem on my computer. however this "workaround" didnt work on almost every other computer i've tried. i use excel 2002. i've tried this code on a few machines running excel 2002 and 2003. i doubt it is a problem with referencing to solver.xla because i check this everytime before i run the macro on a different machine. if this is an old problem that has been mentioned before, i would gladly do a readup if someone would give me directions or point me to a page/thread. thanks in advance . |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
"unexpected error" when running solver from a macro
This does not solver anything, but I thought I might share something with
you. I now have Office 2003 running on Win xp Pro w/ Service Pack #2. I tried an experiment that was discussed before. In my Personal.xls file that is located in the xlstart folder, I set a vba reference to Solver, made Personal.xls hidden, and closed Excel. Basically, that file is now gone! Windows & Excel will not let me open or use that file. I can't figure out how to recover that file. Tomorrow, I'll experiment with a lower security setting, and also work as a logged on Administrator. Right now, I run my programs in windows without "Administrator" privileges. I have noticed a lot of problems now when running programs when you are not logged in as an administrator. I believe this is the preferred way to run your everyday programs according to Microsoft. But... it is causing a lot of problems & headaches. The only kb article that discusses your error is: XL2000: The Solver Add-in May Not Work When You Start Solver by Using a Macro http://support.microsoft.com/default...30&Product=xlw Good luck to us both. Dana DeLouis "floodgate" wrote in message ... hi there, i'm having trouble running the solver from a macro and i was wondering if you guys could help me with it the error message is "Solver: An unexpected internal error occured, or available memory was exhausted." here's the code: SolverReset SolverAdd CellRef:=cellrefstring1, Relation:=2, FormulaText:=cellrefstring2 SolverOptions Iterations:=32767, Precision:=0.1, StepThru:=False, Estimates:=2, Derivatives:=1, SearchOption:=1, Scaling:=False, Convergence:=0.1, AssumeNonNeg:=False, AssumeLinear _ :=True SolverOk MaxMinVal:=3, ValueOf:="0", ByChange:=bychangestring SolverSolve "cellrefstring1" and "bychangestring" are string-type variables. running the macro line by line, i found that the error occurs after the SolverOk line. i also realised that if i dont leave the "SetCell" option empty, and set it to a dummy cell (that isnt affected by the ByChange cells), i will not have this problem on my computer. however this "workaround" didnt work on almost every other computer i've tried. i use excel 2002. i've tried this code on a few machines running excel 2002 and 2003. i doubt it is a problem with referencing to solver.xla because i check this everytime before i run the macro on a different machine. if this is an old problem that has been mentioned before, i would gladly do a readup if someone would give me directions or point me to a page/thread. thanks in advance -- floodgate ------------------------------------------------------------------------ floodgate's Profile: http://www.excelforum.com/member.php...o&userid=14777 View this thread: http://www.excelforum.com/showthread...hreadid=264294 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
what does error message "too many adjustable cells" mean in solver | Excel Discussion (Misc queries) | |||
Circular reference error when trying to keep a "running Tally" | Excel Discussion (Misc queries) | |||
"An unexpected error has occured" | Excel Discussion (Misc queries) | |||
Sheets("Rpt").Copy different results from running in macro than off excel menu?? | Excel Discussion (Misc queries) | |||
"Programmatic Access to be Denied" displays when running macro on excel in XP | Excel Programming |