Premium Solver Macro Problem
Hi all...
I have a problem when i record macro using premium solver. I have an input sheet where the user enters the data and clicks the solve button. the premium solver solves the optimisation problem and displays the result. when i tried to record the macro for the click operation. excel crashes.... I have added both the solver and premium solver references.. My code looks like this when i record... Code: Sub solve() ' Sheets("DataInput-Results").Select ' solve Macro ' Sheets("Model").Activate Dim prob As New Problem prob.Init ActiveSheet prob.Solver.Optimize Set prob = Nothing Sheets("DataInput-Results").Activate End Sub Please help me find the solution for this problem. Thanks Suji |
Premium Solver Macro Problem
Hi Dana...
I did try that part. But its not working still whenever i add the premium solver reference and then run the macro.Excel Crashes...... any idea what my problem is? Suji |
Premium Solver Macro Problem
Hi. Sorry it didn't work. I don't know what to suggest at this point.
prob.Init ActiveSheet I'm sure this is not the problem, but the documentation used the following idea. Perhaps try that. (They should be the same thing... but you never know) Sheets("Model").Activate Dim prob As New Problem prob.Init Worksheets("Model") Are you able to run the code without selecting the worksheet "DataInput-Results" first? Sheets("DataInput-Results").Select ' solve Macro ' <-- Not sure what you are doing here ?? -- Dana DeLouis "Suji" wrote in message ... Hi Dana... I did try that part. But its not working still whenever i add the premium solver reference and then run the macro.Excel Crashes...... any idea what my problem is? Suji |
Premium Solver Macro Problem
Hi Dana,
I tried what you suggested putting model in the init thing. I also removed the other sheet and used only model.activate command. Evne then it is crashing.. This is totally strange. I have mailed the people who built it. explaining the problem. Waiting for their response. Thanks for your suggestions even though it didnt workout. I appreciate your help Suji |
All times are GMT +1. The time now is 01:45 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com